51. What will be the output of the following Python code?
l=[[1, 2, 3], [4, 5, 6]]
for i in range(len(l)):
for j in range(len(l[i])):
l[i][j]+=10
l
l=[[1, 2, 3], [4, 5, 6]]
for i in range(len(l)):
for j in range(len(l[i])):
l[i][j]+=10
l
52. To shuffle the list(say list1) what function do we use?
53. What will be the output of the following Python code?
t=32.00
[round((x-32)*5/9) for x in t]
t=32.00
[round((x-32)*5/9) for x in t]
54. To which of the following the "in" operator can be used to check if an item is in it?
55. Read the information given below carefully and write a list comprehension such that the output is: ['e', 'o']
w="hello"
v=('a', 'e', 'i', 'o', 'u')
w="hello"
v=('a', 'e', 'i', 'o', 'u')
56. What will be the output of the following Python code?
import math
[str(round(math.pi)) for i in range (1, 6)]
import math
[str(round(math.pi)) for i in range (1, 6)]
57. What will be the output of the following Python code?
l=[1,2,3,4,5]
[x&1 for x in l]
l=[1,2,3,4,5]
[x&1 for x in l]
58. What will be the output of the following Python code?
a = [1, 5, 7, 9, 9, 1]
b=a[0]
x= 0
for x in range(1, len(a)):
if a[x] > b:
b = a[x]
b= x
print(b)
a = [1, 5, 7, 9, 9, 1]
b=a[0]
x= 0
for x in range(1, len(a)):
if a[x] > b:
b = a[x]
b= x
print(b)
59. What will be the output of the following Python code?
a="hello"
b=list((x.upper(),len(x)) for x in a)
print(b)
a="hello"
b=list((x.upper(),len(x)) for x in a)
print(b)
60. What will be the output of the following Python code?
values = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for row in range(0, len(values)):
for column in range(0, len(values[row])):
if v < values[row][column]:
v = values[row][column]
print(v)
values = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for row in range(0, len(values)):
for column in range(0, len(values[row])):
if v < values[row][column]:
v = values[row][column]
print(v)
Read More Section(Lists in Python)
Each Section contains maximum 100 MCQs question on Lists in Python. To get more questions visit other sections.