CSE MCQs :: Python MCQs
-
What is the output of the code shown below?import math[str(round(math.pi)) for i in range (1, 6)]
-
What is the output of the following?print([i.lower() for i in "HELLO"])
- Suppose list1 is [1, 3, 2], What is list1 * 2 ?
-
What will be the output?names1 = ['Amir', 'Bala', 'Charlie']names2 = [name.lower() for name in names1]print(names2[2][0])
-
What will be the output?values = [[3, 4, 5, 1], [33, 6, 1, 2]]v = values[0][0]for lst in values:for element in lst:if v > element:v = elementprint(v)
-
What is the output of the following code?import copya=[10,23,56,[78]]b=copy.deepcopy(a)a[3][0]=95a[1]=34print(b)
-
What is the output of the following piece of code?a=list((45,)*4)print((45)*4)print(a)
-
What is the output of the code shown below?A = [[1, 2, 3],[4, 5, 6],[7, 8, 9]][A[i][len(A)-1-i] for i in range(len(A))]