CBSE CS

List in Python

MCQ on List

Click on the buttons inside the tabbed menu:

MCQ Set 1

List Multiple choice question in Python

 

1 List can contain values of these types:





ANSWER= D) all of these

 

2 Which of the following will create an empty list ?





ANSWER= A)L=[]

 

3 Which of the following will return the last element of a list L with 5 elements?





ANSWER= B) L[4]

 

4 If L=[1,2] then L*2 will yield





ANSWER= D) [1,2,1,2]

 

5 L1=[1,3,5] and L2=[2,4,6] then L1 + L2





ANSWER= B) [1,3,5,2,4,6]

 

6 Given a list L=[10,20,30,40,50,60,70], what would L[1:4] return?





ANSWER= C) [20,30,40]

 

7 Given a list L=[10,20,30,40,50,60,70], what would L[2:-2] return?





ANSWER= D) [30,40,50]

 

8 Given a list L=[10,20,30,40,50,60,70], what would L[-4:-1] return?





ANSWER= C) [40,50,60]

 

9 Given a list L=[10,20,30,40,50,60,70], then L[-3:]





ANSWER= D) [50,60,70]

 

10 To find the last element of list namely 'smiles' in Python ,_____ will be used.





ANSWER= B) smiles[-1]

LIST MCQ Set 2

List Multiple choice question in Python

 

11 What is printed by the Python code?
print(list(range(3)))





ANSWER= C) [0,1,2]

 

12 Which of the following commands will create a list?





ANSWER= D) all of these

 

13 What si the output when we execute list('hello')?





ANSWER= A)['h','e','l','l','o']

 

14 What gets printed?
names=['Hasan','Balwant','Sean','Dia']
print(names[-1][-1])





ANSWER= D) a

 

15 What is the output of the following :
l=[None]*10
print(len(l))





ANSWER= A)10

LIST MCQ Set 3

List Multiple choice question in Python. Coming soon

Click the button to see more MCQ