Q101
Open questionnames1 = ['Amir', 'Bala', 'Charlie']
names2 = [name.lower() for name in names1]
print(names2[2][0])Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
147
Questions
6/8
Page
Pick an option on a question to see the right answer and solution.
Q101
Open questionnames1 = ['Amir', 'Bala', 'Charlie']
names2 = [name.lower() for name in names1]
print(names2[2][0])Select an option to see the answer and solution.
Q102
Open questionprint([[i+j for i in "abc"] for j in "def"])Select an option to see the answer and solution.
Q103
Open questionl1=[1,2,3]
l2=[4,5,6]
[x*y for x in l1 for y in l2]Select an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open questionSelect an option to see the answer and solution.
Q106
Open questionSelect an option to see the answer and solution.
Q107
Open questionb=[2,3,4,5]
a=list(filter(lambda x:x%2,b))
print(a)Select an option to see the answer and solution.
Q108
Open questionpoints = [[1, 2], [3, 1.5], [0.5, 0.5]]
points.sort()
print(points)Select an option to see the answer and solution.
Q109
Open questiondef f(values):
values[0] = 44
v = [1, 2, 3]
f(v)
print(v)Select an option to see the answer and solution.
Q110
Open questions="a@b@c@d"
a=list(s.partition("@"))
print(a)
b=list(s.split("@",3))
print(b)Select an option to see the answer and solution.
Q111
Open questionprint([i.lower() for i in "HELLO"])Select an option to see the answer and solution.
Q112
Open questionmatrix = [[1, 2, 3, 4],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]]
for i in range(0, 4):
print(matrix[i][1], end = " ")Select an option to see the answer and solution.
Q113
Open questionA = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
A[1]Select an option to see the answer and solution.
Q114
Open questionlist1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
print(len(list1 + list2))Select an option to see the answer and solution.
Q115
Open questiona=[10,23,56,[78]]
b=list(a)
a[3][0]=95
a[1]=34
print(b)Select an option to see the answer and solution.
Q116
Open questiondef addItem(listParam):
listParam += [1]
mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))Select an option to see the answer and solution.
Q117
Open questionx=[[1],[2]]
print(" ".join(list(map(str,x))))Select an option to see the answer and solution.
Q118
Open questiona=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)Select an option to see the answer and solution.
Q119
Open questionA = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
[[col + 10 for col in row] for row in A]Select an option to see the answer and solution.
Q120
Open questiona=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)Select an option to see the answer and solution.