XI Python Revision MCQ
XI Python Revision MCQ
3
Which of the following operator can be used with string data type?
1. ** 2. % 3. + 4. /
Answer is:3
4 Consider a tuple T = (10, 15, 25, and 30). Identify the statement that will result in an error.
1. print(T[2]) 2. T[3] = 19 3. print(min(T)) 4. print(len(T))
Answer is: 2
5
Which of the following symbol is used in Python for Multiline comments line comment?
1. /*** 2. /* 3. „‟‟ 4. #
Answer is:
6
Identify the output of the following Python statements.
3
y = x[1][2] print(y)
Answer is: 3
7
Identify the output of the following Python statements.
L.insert( 3, 4)
L.insert( 2, 3)
print (lst1[-5])
1. 2 2. 3 3. 4 4. 20
Answer is:2
8
Which of the following properly expresses the precedence of operators (using parentheses) in
the following expression: 5*3 > 10 and 4+6==11
Answer is : 1
9
What will be the output of the following Python code?
i=1
while True:
if i%0O7 == 0:
break
print(i)
4
i += 1
1. 1 2 3 4 5 6
2. 1 2 3 4 5 6 7
3. error
Answer is: 1
10
values = [1, 2, 3, 4]
numbers = set(values)
def checknums(num):
if num in numbers:
return True
else:
return False
print i
1. 1 2 3 4 2. 1 2 3. 3 4 5. 2 3 4
Answer is:1
import ___________________ #1
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3)
5
TO=random.randint(2,4)
for K in range(FROM,TO+1):
print (AR[K],end=”#“)
Answer is: ii
2
What will Be the maximum value of the variables FROM and TO?
Answer is : I
3
What will Be the minimum value of the variables FROM and TO?
Answer is: ii
4
What possible outputs(s) are expected to be displayed on screen at the time of execution
of the program?
Answer is: ii
5
What will be the output of random.random ( )
Answer is : ii
6 Ramu write a list program as shown below .based on the code answer the questions
print(m) #2
v = m[0][0]
print(v) #3
for row in m:
for element in row:
if v < element:
v = element
return v
print(fun(data[0])) #4
7
What will be printed after execution of the line #2 ?
(i) [1,2] (ii) [[1, 2], [3, 4]] (iii) [[5, 6], [7, 8]] (iv) [5,6]
Answer is:ii
8
What will be printed after execution of the line #3 ?
Answer is: iv
9
What will be last line of the output after execution of the line #4 ?
Answer is: i
10
What will be the last line of the output of the above code, if line #4 is replaced with print
(fun (data (1)) ?
Answer is: i