Date:03-12-2021
Class XI MCQ on List in Python
1. Write the output of the following :
L = “123456”
L = list(L)
print(type(L[0]))
a. class ‘str’ b. class ‘int’ c. 1 d. Error
2. Write the output of the following:
T=(1,2,3,4,5.5)
L = list(T)
print(L[3]*2.5)
a. Error b. 10 c. 10.0 d. 4
3. Index value in list and string start from 0(T/F)
a. True b. False
4. Write the output of the following:
T=(1,2,3,4,5.5)
L = list(T)
print(L*2)
a. [2, 4, 6, 8, 11] b. [1, 2, 3, 4, 5.5, 1, 2, 3, 4, 5.5]
c. Error d. None of the above
5. Write the output of the following:
T = [1,2,3,4]
T1 = [3,4,5,6]
T2 = T + T1
print(T2)
a. [1, 2, 3, 4, 5, 6] b. [1, 2, 3, 4, 3, 4, 5, 6] c. [4, 6, 8, 10] d. Error
6. Write the output of the following:
T = [1,2,3,4]
T1 = [3,4,5,6]
T2 = T.append(T1)
print(T2)
a. [1, 2, 3, 4, [3, 4, 5, 6]] b. [1, 2, 3, 4, 3, 4, 5, 6]
c. None d. None of the above
7. del statement can delete the following from the List?
a. Single Element b. Multiple Elements
c. All elements along with List object d. All of the above
8. Write the output of the following:
T = [1,2,3,4]
T1=T
T[0] = “A”
print(T)
print(T1)
a.['A', 2, 3, 4] [1, 2, 3, 4] b.['A', 2, 3, 4] ['A', 2, 3, 4]
c.[1, 2, 3, 4] [1, 2, 3, 4] d. Error
9. What type of error is returned by the following statement?
T = [1,2,3,4]
print(T.index(9))
a. IndexError b. TypeError c. ValueError d. None of the above
10. Write the output of the following.
T = [1,2,3,4]
T1=[5,6,7]
L=T.append(T1)
print(L)
a. None b. [1, 2, 3, 4, [5, 6, 7]]
c. [ ] d. Error
11. Write the output of the following:
L=["Amit","Sumit","Naina"]
L1=["Sunil"]
print(L + L1)
a. [“Amit” , “Sumit” , “Naina” , [“Sunil”] ]
b. [‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’]
c. Error
d. [‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’][‘Amit’ , ‘Sumit’ , ‘Naina’ , ‘Sunil’]
12. Result of list slice is also a list?(T/F)
a. True b. False
13. What we call the operation which is used to extract particular range from a
sequence.
a. Slicing b. range c. Indexing d. Replication
14. Index of last element in list is n-1, where n is total number of elements.(T/F)
a. True b. False
15. Write the output of the following :
L=[2 * x for x in range(3,14,3)]
print(L)
a. [6, 12, 18, 24] b. [6, 12, 18] c. [6, 12, 18, 24, 30] d. Error
16. Write the output of the following :
L=["Amit","Sumit","Naina"]
L1=["Sumit"]
print(L - L1)
a. [“Amit” , “Naina”] b. [“Amit” , “Naina”, “Sumit”]
c. Show Error d. None of the above
17. Following two print statement will return same result.(T/F)
L1 = [1, 5, 9]
L2 = [2, 3, 4]
print(L1 + L1)
print(L1 * 2)
a. True b. False
18. Which of the following is not list operation?
a. Indexing b. Slicing c. Dividing d. Concatenation
19. Which of the following is true about List data type in Python?
a. List is a Sequence data type b. List is mutable
c. List can have elements of different data type
d. All of the above
20. Write the output of the following write output.
a = [1,2,3,4]
a.append([7,8])