70+ Best List Manipulation in Python MCQ Class 11-12

70+ Best List Manipulation in Python MCQ Class 11-12

In this section you will practice List in Python MCQ for your board exam preparation. These MCQs are designed for objective as well as subjective type questions. These  List in Python MCQ will also help in Output based List in Python questions. It covers all possible List Manipulation in Python. 

1. What will be the output :

nameList = [‘Harsh’, ‘Pratik’, ‘Bob’, ‘Dhruv’]   

print nameList[1][-1] 

a) Pratik

b) Bob

c) D

d) k

d) k

 

 

 

2. Find the output:

Code = [1, 2, 3, 4]

Code.append([5,6,7,8]) 

print(Code)

a) [1,2,3,4,5,6,7,8]

b) [1,2,3,4]

c) [1,2,3,4,[5,6,7,8]]

d) [1,2,3,4][5,6,7,8]

c) [1,2,3,4,[5,6,7,8]]

 

 

 

3. Find the output:

list1 = [1, 2, 3, 4, 5]

list2 = list1 

list2[0] = 0; 

print( list1)

a) [1, 2, 3, 4, 5, 0]

b) [0,1, 2, 3, 4, 5]

c) [0, 2, 3, 4, 5]

d) [1, 2, 3, 4, 0]

c) [0, 2, 3, 4, 5]

 

 

4. Find the output:

list1 = [1998, 2002]

list2 = [2014, 2016] 

print ((list1 + list2)*2)

 

a) [1998, 2002, 2014, 2016, 1998, 2002, 2014, 2016]

b) [1998, 2002, 2014, 2016]

c) [1998, 2002, 1998, 2002]

d) [2014, 2016, 2014, 2016]

a) [1998, 2002, 2014, 2016, 1998, 2002, 2014, 2016]

 

 

5. Find the output:

list = [1, 2, 3, None, (1, 2, 3, 4, 5), [‘Hi’, ‘Hello’, ‘Bye’]]

print(len(list))

a) 12

b) 11

c) 22

d) 6

d) 6

 

 

6. Find the output :

list = [‘python’, ‘learning’, ‘@’, ‘cbse’, ‘python’, ‘.in’]

print(list[0:6:2])

 

a) [‘python’, ‘@’, ‘python’]

b) [‘python’, ‘learning’, ‘@’]

c) [‘python’, ‘learning’, ‘@’, ‘python’, ‘in’]

d) [‘python’, ‘in’]

a) [‘python’, ‘@’, ‘python’]

 

 

7. Find the output:

d1 = [10, 20, 30, 40, 50]

d2 = [1, 2, 3, 4, 5]

print( d1 – d1 )

a) [10, 20, 30, 40, 50]

b) [1, 2, 3, 4, 5]

c) [10, 20, 30, 40, 50,-1, -2, -3, -4, -5]

d) No Output

d) No Output

 

 

8. Find the output:

list = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

print(list[10:] )

 

a) [‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

b) [ ‘c’, ‘d’, ‘e’]

c) [ ]

d) [‘a’, ‘b’]

c) [ ]

 

 

9. Find the output :

L1 = [1, 2, 3, 4]

L2 = L1

L3 = L1.copy()

L4 = L1

L1[0] = [5]

print(L1, L2, L3, L4)

a) [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4] [1, 2, 3, 4]

b) [[5], 2, 3, 4] [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4]

c) [5, 2, 3, 4] [5, 2, 3, 4] [5, 2, 3, 4] [1, 2, 3, 4]

d) [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4] [[5], 2, 3, 4]

d) [[5], 2, 3, 4] [[5], 2, 3, 4] [1, 2, 3, 4] [[5], 2, 3, 4]

 

 

10. Find the output:

L = [1, 3, 5, 7, 9]

print(L.pop(-3), end = ‘ ‘)

a) 5

b) 9

c) 7

d) 3

a) 5

 

 

11. What is the output:

myList = [“PYthon”, [4, 8, 12, 16]]

print(myList[0][1])   

print(myList[1][3])

 

a) P 8
Y 16

 

b) P
12

 

 c) Y
16

 

d) Python
8

b) P
12

 

 

12. What is the output:

myList = [1, 2, 3, 4, 5, 6, 7]

pow2 =  [2 * x for x in myList]

print(pow2)

a) [1, 2, 3, 4, 5, 6, 7]

b) [2, 4, 6, 8, 10, 12, 14]

c) [2, 4, 6, 8, 10, 12]

d) [1, 2, 3, 4, 5, 6, ]

b) [2, 4, 6, 8, 10, 12, 14]

 

 

13. What is the output :

myList= [4, 8, 12, 16]

myList[1:4] = [20, 24, 28]

print(myList)

a) [4, 20, 24, 28, 8, 12, 16]

b) [4, 20, 24, 28]

c) [20,24,28]

d) [4, 8, 12, 16, 20, 24, 28]

b) [4, 20, 24, 28]

 

 

14. What is the output:

myList= [5, 10, 15, 25]

print(myList[::-2])

a) [5,10]

b) [25,10]

c) [15,5]

d) [15,10,5]

b) [25,10]

 

 

15. What is the output:

myList= [10, 20, 30, 40, 50, 60, 70, 80]

print(myList[2:5])

print(myList[:4])

print(myList[3:])

 

a) [20, 30, 40, 50]

[10, 20, 30, 40]

[30, 40, 50, 60, 70, 80]

 

b) [30, 40, 50]

[10, 20, 30, 40]

[40, 50, 60, 70, 80]

 

c) [20, 30, 40, 50]

[10, 20, 30, 40]

 

d) [10, 20, 30, 40]

[40, 50, 60, 70, 80]

b) [30, 40, 50]

[10, 20, 30, 40]

[40, 50, 60, 70, 80]

 

 

16. What is the output:

sampleList = [10, 20, 30, 40, 50]

sampleList.append(60)

print(sampleList)

sampleList.append(60)

print(sampleList)

 

a) [10, 20, 30, 40, 50]

b) [10, 20, 30, 40, 50,60,60]

c) [10, 20, 30, 40, 50,60]

d) [10, 20, 30, 40, 60]

b) [10, 20, 30, 40, 50,60,60]

 

 

17. What is the output:

sampleList = [10, 20, 30, 40, 50]

sampleList.pop()

print(sampleList)

sampleList.pop(2)

print(sampleList)

 

a) [10, 20, 30, 40, 50]

[10, 20, 30, 40]

 

b) [20, 30, 40, 50]

[10, 20, 40]

 

c) [10, 20, 30, 40]

[10, 20, 30, 50]

 

d) [10, 20, 30, 40]

[10, 20, 40]

d) [10, 20, 30, 40]

[10, 20, 40]

 

 

18. What is the printed?

grades=[ ]

grades.append(45)

grades.append(35)

grades.append(21)

print(grades)

 

a) [45,35,21]

b) [21]

c) [45,35]

d) [ ]

a) [45,35,21]

 

 

19. What is the output :

val=[1,2,3,4,3,5,6,7,7,8]

x=7

print val.count(x)

a) 2

b) 3

c) 4

d) 5

a) 2

 

 

20. Statement 1: append (): Appends a single element passed as an argument at the end of the list.

Statement 2: extend() Appends each element of the list passed as argument at the end of the given list

Which statement is correct?

a) Statement 1

b) Statement 2

c) Both Statement 1 and 2 are correct

d) Both Statement 1 and 2 are incorrect.

c) Both Statement 1 and 2 are correct

 

 

70+ List in Python MCQ Class 11-12

 

21. What will be the output of the following code segment? 

list1 =[‘Red’, ‘Green’, ‘Blue’, ‘Cyan’, ‘Magenta’,

‘Yellow’, ‘Black’]

print(list1[-4:0:-1])

a) [‘Cyan’, ‘Blue’, ‘Green’, ‘Red’]

b) []

c) [‘Cyan’, ‘Blue’, ‘Green’] 

d) [‘Cyan’, ‘Magenta’, ‘Yellow’, ‘Black’]

c) [‘Cyan’, ‘Blue’, ‘Green’] 

 

 

 

22. Which of the following is a mutable sequence data type?

a) string

b) list

c) tuple

d) All of the mentioned

b) list

 

 

23. Which of the following is not an immutable data type:

a) string

b) complex

c) list

d) tuple

c) list

 

 

 

24. Which statement does not show any error after execution? Given L=[1,2,3,4] (U)

a) print(L+L) 

b) print(L*L)

c) print(L-L)

d) All of the mentioned

a) print(L+L) 

 

 

 

25. Which of the following command(s) will create a list?

a) list1 = list()

b) list1 = []

c) list1 = list([1, 2, 3])

d) all of these

d) all of these

 

 

26. Which command can we use to insert 5 to the third position in list1?

a) list1.insert(3, 5)

b) list1.insert(2, 5) 

c) list1.add(3, 5)

d) list1.append(3, 5)

b) list1.insert(2, 5) 

 

 

27. Which of the following commands will sort list1 in descending order?

a) list1.sort(reverse=0)

b) list1.sort()

c) list1.sort(reverse=‘True’)

d) list1.sort(reverse=1) 

d) list1.sort(reverse=1) 

 

 

28. Which command we use cane use To remove string “hello” from list1, Given, list1=[“hello”]

a) list1.remove(“hello”)

b) list1.pop(list1.index(‘hello’))

c) both a & b

d) none of these

c) both a & b

 

 

29. What will be the output of the following code segment?

list1 = [10,20,30,10,40,10]

print(list1.remove(10))

a) 10

b) [20,30,40]

c) None

d) []

c) None

 

 

30. What will be the output of the following code segment?

L=’good’

L=[1,2,3]

n=2

print(L*n)

 

a) goodgood

b) [1, 2, 3, 1, 2, 3] 

c) error

d) none

b) [1, 2, 3, 1, 2, 3] 

 

 

31. What will be the output of the following code segment?

l=[‘A’,’a’,’Aa’,’aA’]

print(max(l))

a) ‘aA’

b) ‘A’,

c) ‘a’

d) ‘Aa’

a) ‘aA’

 

 

32. pop() returns the element whose index is passed as argument to this function and also  removes it from the list. If no argument is given, then it returns and removes the _____element of the list. Fill in the Blank Space.

a) None

b) first

c) last

d) all

c) last

 

 

33. What will be the output of the following code segment?

l=list(range(100,20,-20))

print(l)

a) [100 80 60 40]

b) [100, 80, 60, 40]

c) [100,20,-20]

d) error

b) [100, 80, 60, 40]

 

 

34. What will be the output of the following code segment?

myList = [1,2,3,4,5,6,7,8,9,10]

newList=[]

for i in range(0,len(myList)):

if i%2 == 0:

newList.append(myList[i])

print(newList)

a) [1,3,5,7,9] 

b) [1,3,5,7]

c) []

d) [1,2,3,4,5,6,7,8,9,10]

a) [1,3,5,7,9]

 

 

 

35. Given list1 = [34,66,12,89,28,99]

Statement 1: list1.reverse()

Statement 2: list1[::-1]

Which statement modifies the contents of original list1.

a) Statement 1

b) Statement 2

c) Both Statement 1 and 2.

d) none of the mentioned

a) Statement 1

 

36. Given a string: s=”String”. Which statement converts string ‘s’ into List ‘L’.

a) L=s

b) L=list(s) 

c) L=s[::]

d) all of the mentioned

b) L=list(s) 

 

 

37. What will be the output of the following code segment?

list1 = [10,20,30,10,40,10]

print(list1.index(10))

a) [0]

b) [0,3,5]

c) 0

d) 1 3 5

c) 0

 

 

38. The record of a student (Name, Roll No, Marks in five subjects and percentage of marks) is stored in the following list:

stRecord = [‘Raman’,’A-36′,[56,98,99,72,69], 78.8]

Write Python statements to retrieve the following information from the list stRecord.

a) print(stRecord [2][4])

b) print(stRecord [2][-1])

c) print(stRecord [-2][-1])

d) all of the mentioned

d) all of the mentioned

 

 

39. S1: Operator + concatenates one list to the end of another list.

S2: Operator * is to multiply the elements inside the list.

Which option is correct?

a) S1 is correct, S2 is incorrect

b) S1 is incorrect, S2 is incorrect

c) S1 is incorrect, S2 is incorrect

d) S1 is incorrect, S2 is correct

a) S1 is correct, S2 is incorrect

 

 

40. Which type of copy is shown in the following python code? 

1s1=[[10, 20], [30, 40], [50, 60]]

1s2=list(1s1)

a) Shallow copy

b) Deep copy

c) memberwise

d) All of the mentioned

a) Shallow copy

 

 

70+ List in Python MCQ Class 11-12

 

41. What is the data type of x after the following statement?

x = [7, 8, 9, 10]

a) List

b) Dictionary

c) Tuple

d) String

a) List

 

 

42. What is the data type of x after the following statement?

x = [‘Today’, ‘Tomorrow’, ‘Yesterday’]

a) List

b) Dictionary

c) Tuple

d) String

a) List

 

 

43. What will be the output after the following statements?

x = [‘Today’, ‘Tomorrow’, ‘Yesterday’]

y = x[1]

print(y)

a) x1

b) Today

c) Tomorrow

d) Yesterday

c) Tomorrow

 

 

44. What will be the output after the following statements?

x = [25, 35, 45]

y = x[0]

print(y)

a) x0

b) 25

c) 35

d) 45

b) 25

 

 

45. What will be the output after the following statements?

x = [10, 20, 30]

y = x[1] + x[2]

print(y)

a) 20

b) 30

c) 40

d) 50

d) 50

 

 

46. What will be the output after the following statements?

x = [‘Sunday’, ‘Monday’, ‘Tuesday’]

y = x[1] + x[2]

print(y)

a) MondayTuesday

b) SundayMonday

c) SunMonday

d) Monday Tuesday

a) MondayTuesday

 

 

47. What will be the output after the following statements?

x = [[0.0, 1.0, 2.0],[4.0, 5.0, 6.0]]

y = x[1][2]

print(y)

a) 0.0

b) 1.0

c) 5.0

d) 6.0

d) 6.0

 

 

48. What will be the output after the following statements?

x = [[0.0, 1.0, 2.0],[4.0, 5.0, 6.0]]

y = x[0][1] + x[1][0]

print(y)

a) 1.0

b) 4.0

c) 5.0

d) 6.0

c) 5.0

 

 

49. What will be the output after the following statements?

x = 3

y = 4

print(x*y)

a) 3

b) 4

c) 3 4

d) 12

d) 12

 

 

50. What will be the output after the following statements?

x = [15, 45, 85, 95]

print(x[3]-x[1])

a) 30

b) 40

c) 50

d) 10

c) 50

 

 

51. What will be the output after the following statements?

x = [5, 4, 3, 2]

print(x)

a) [5, 4, 3, 2] 

b) 5, 4, 3, 2

c) 5432

d) (5, 4, 3, 2)

a) [5, 4, 3, 2] 

 

 

52. What will be the output after the following statements?

x = [5, 4, 3, 2]

x.append(1)

print(x)

a) [5, 4, 3, 2]

b) 5, 4, 3, 2, 1

c) 5432

d) [5, 4, 3, 2, 1] 

d) [5, 4, 3, 2, 1] 

 

 

53. What will be the output after the following statements?

x = [5, 4, 3, 2]

x.insert(1, 0)

print(x)

a) [5, 1, 3, 2, 0]

b) [5, 0, 4, 3, 2] 

c) [0, 5, 4, 3, 2]

d) [1, 5, 4, 3, 2]

b) [5, 0, 4, 3, 2] 

 

 

54. What will be the output after the following statements?

x = [5, 4, 3, 2]

x.remove(2)

print(x)

a) [5, 3, 2]

b) [5, 4, 3] 

c) [5, 4, 2]

d) [3, 2]

b) [5, 4, 3] 

 

 

55. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

print(x.pop(3))

a) 4

b) 3

c) 2

d) 1

c) 2

 

 

56. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

print(x.index(1))

a) 4

b) 3

c) 2

d) 1

a) 4

 

 

57. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

x.extend(x)

print(x)

a) [5, 4, 3, 2, 1]

b) []

c) [1, 2, 3, 4, 5]

d) [5, 4, 3, 2, 1, 5, 4, 3, 2, 1] 

d) [5, 4, 3, 2, 1, 5, 4, 3, 2, 1] 

 

 

58. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

y = [0, 5, 10]

x.extend(y)

print(x)

a) [5, 4, 3, 2, 1, 0, 5, 10] 

b) []

c) [5, 4, 3, 2, 1]

d) [0, 5, 10, 5, 4, 3, 2, 1]

a) [5, 4, 3, 2, 1, 0, 5, 10] 

 

 

59. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

y = [10, 5, 0]

x.extend(y)

print(y)

a) [5, 4, 3, 2, 1, 10, 5, 0]

b) []

c) [10, 5, 0, 5, 4, 3, 2, 1]

d) [10, 5, 0] 

d) [10, 5, 0] 

 

 

60. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

y = [10, 5, 0]

y.extend(x)

print(y)

a) [5, 4, 3, 2, 1, 10, 5, 0]

b) [10, 5, 0, 5, 4, 3, 2, 1] 

c) [5, 4, 3, 2, 1]

d) [10, 5, 0]

b) [10, 5, 0, 5, 4, 3, 2, 1] 

 

 

70+ List in Python MCQ Class 11-12

 

61. What will be the output after the following statements?

x = [5, 4, 3, 2, 1]

x.reverse()

print(x)

a) [0, 1, 2, 3, 4, 5]

b) [0, 5, 4, 3, 2, 1]

c) [5, 4, 3, 2, 1, 0]

d) [1, 2, 3, 4, 5] 

d) [1, 2, 3, 4, 5] 

 

 

62. What will be the output after the following statements?

x = [25, 14, 53, 62, 11]

x.sort()

print(x)

a) [11, 14, 25, 53, 62] 

b) [25, 14, 53, 62, 11]

c) [62, 53, 25, 14, 11]

d) [25, 53, 62, 14, 11]

a) [11, 14, 25, 53, 62] 

 

 

63. What will be the output after the following statements?

x = [’25’, ‘Today’, ’53’, ‘Sunday’, ’15’]

x.sort()

print(x)

a) [‘Today’, ‘Sunday’, ’15’, ’25’, ’53’]

b) [‘Sunday’, ‘Today’, ’15’, ’25’, ’53’]

c) [’15’, ’25’, ’53’, ‘Sunday’, ‘Today’] 

d) [’15’, ’25’, ’53’, ‘Today’, ‘Sunday’]

c) [’15’, ’25’, ’53’, ‘Sunday’, ‘Today’] 

 

 

64. What will be the output after the following statements?

x = [25, ‘Today’, 53, ‘Sunday’, 15]

x.reverse()

print(x)

a) [‘Today’, ‘Sunday’, 15, 25, 53]

b) [15, ‘Sunday’, 53, ‘Today’, 25] 

c) [15, 25, 53, ‘Sunday’, ‘Today’]

d) [15, 25, 53, ‘Today’, ‘Sunday’]

b) [15, ‘Sunday’, 53, ‘Today’, 25] 

 

 

65. What will be the output after the following statements?

x = [25, 35, 53, 25, 52, 35, 25]

print(x.count(25))

a) 25

b) 3

c) 53

d) 35

b) 3

 

 

66. What will be the output after the following statements?

x = [25, 35, 53, 25, 52, 35, 25]

print(len(x))

a) 25

b) 5

c) 7

d) 35

c) 7

 

 

67. What will be the output after the following statements?

x = [25, 35, 53, 25, 52, 35, 25]

len(x)

print(x)

a) 25

b) 5

c) 7

d) [25, 35, 53, 25, 52, 35, 25]

d) [25, 35, 53, 25, 52, 35, 25]

 

 

68. What will be the output after the following statements?

x = [25, 35, 53, 25, 52, 35, 25]

del x[3]

print(x)

a) [25, 35, 53, 52, 35, 25] 

b) [25, 5, 5, 25, 52, 5, 25]

c) [35, 53, 52, 35]

d) [25, 35, 53, 25, 52, 35, 25]

a) [25, 35, 53, 52, 35, 25] 

 

 

69. What will be the output after the following statements?

x = [5, 3, 6, 2, 4, 0, 1]

del x[2:3]

print(x)

a) [5, 3, 6, 4, 0, 1]

b) [5, 3, 2, 4, 0, 1] 

c) [5, 6, 2, 4, 0, 1]

d) [5, 4, 0, 1]

b) [5, 3, 2, 4, 0, 1] 

 

 

70. What will be the output after the following statements?

x = [5, 3, 6, 2, 4, 0, 7]

del x[0:7]

print(x)

a) [ ]

b) [5, 3, 6, 2, 4, 0, 7]

c) [5, 3, 6, 2, 4, 0]

d) [3, 6, 2, 4, 0]

a) [ ]

 

 

71. What will be the output after the following statements?

x = [5, 3, 6, 2, 4, 0, 7]

del x[0:4]

print(x)

a) []

b) [5, 3, 6, 2, 7]

c) [5, 3, 6, 2, 4, 0]

d) [4, 0, 7] 

d) [4, 0, 7] 

 

 

72. What will be the output after the following statements?

x = [5, 3, 6, 2, 4, 0, 7]

del x[:]

print(x)

a) [ ]

b) [5, 3, 6, 2, 7]

c) [5, 3, 6, 2, 4, 0]

d) [4, 0, 7]

a) [ ]

 

 

73. What will be the output after the following statements?

x = [4, 0, 7]

y = str(x[0]) + str(x[1])

print(y)

a) 11

b) 4

c) 40

d) 7

c) 40

 

 

74. What will be the output after the following statements?

x = [4, 0, 7]

y = float(x[0] + x[2])

print(y)

a) 11

b) 11.0 

c) 47.0

d) 47

b) 11.0 

 

 

In above article you learned and practice List in Python MCQs, Output based questions in List, List Manipulation in Python. 

For List in Python Quick Revision Notes for Class 11 and 12 explore this site.