Welcome to your Python MCQ(M3-R5) Chapter-2
1.
What are the values of the following Python expressions?2**(3**2) (2**3)**2 2**3**2
2.
range (3) in Python is equivalent to 😕
3.
Which of the following is false regarding loops in python ?
4.
What will be the result of following Python code snippet after execution?strl="" i=0 var2=1 while(i
5.
What does the following code print ? if 2+5==8: print(" true ") else: print ("false ") print (" true")
6.
What will following code segment print? a=true b=false c=false if not a or b: print(1) elif not a or not b and c: print(2) elif not a or b or not b and a: print(3) else: print(4)
7.
Which of the following is the output of this program? true=false while true print(true) break
8.
Which of the following Boolean expressions is not logically equivalent to other three?
9.
Which arithmetic operators can not use with strings?
10.
What value does the following expression evaluate to? x=5 while x < 10 : print (x, end=' ')
11.
Which of the following is the output of this program?i=5 while true if i9==0:break print (i) i+=1
12.
What will be the output of the following Python code? m=[[x,x+1,x+2] for x in range (0,3)] print (m)
13.
To access a list which contains ten elements which of the following uses of range () would produce a list of the desired indexes?
14.
What will be the output of the following Python code? x="abcd" for i in range (x) : print (' i' )
15.
What will be the final value of I after execution of the loop? for I in range(10) : print (I)
16.
What among the following list of operators has the highest precedence?+,-,**,%/,,|
17.
What will be output after execution of the following cod? x=13 if x>12 or x
18.
Write the output of the following code? s="olevel" for i in range(-1,- len (s),-1) : print (s [i], end = "$")
19.
Which of the following is the correct output of this program? i=0 whilei
20.
What will be the output of the given program segment? a=10 b=5 if (a%b==0): print(" Greater") if (a//b==0) : print ("example")else : print ("sooo sorry")
21.
Which of the following expression is correct?
22.
What will be the output of the following Python code? x= "abcdef" i="a" while i in x: x= x[:-1] print (i,end = ' ')
23.
Amongst which of the following is / are true with reference to loops in Python?
24.
Find the output of the following python code? i=0 sum=0 while i
25.
What will be the output of the following ? print (( range(4)))
26.
What will be the output of the following program on execution? if false: print (" inside if block")elif true: print ("inside elif block")else: print 9 " inside else block")
27.
What will be the output of the following code snippet? z="abc" j="j" while j in z: print (j, end="")
28.
What will be the output of the following code snippet? count = 0 while (true): if count%3==0: print (count,end=' ') if ( count>15): break; count +=1
29.
In a Python program, Nested if statements denotes?
30.
What will be the output of the following code snippet?i=0 while i
31.
What will be the output of the following Python list comprehension? print ([j for i in range(2,8) for j in range ( i*2,50, i)])
32.
Find the output of the following program segments:? country = ' INDIA' for i in country : print ( i, end= ' ' )
33.
What will be the output of the following code snippet?word= "python programming" n= len (word) word1= word. upper () word= word. lower() converted_ word ="" for i in range (n) : if i %2==0: converted_ word+= word2 [i]else: converted_word+ word1 [1] print ( converted_ word)
34.
What will be output after execution of the following code? a=1 while true: if a % 7==0: break print(a) a+=1
35.
What will be the output after the following statements? x=2 if x
36.
What will be the output of the following Python code? for i in ' abcd; [: :-1]; print (i)
37.
What will be the output after the following statements? a=0 b=3 while a+b
38.
What will be the output of the following Python code? for i in range (10): if i==5: break else: print (i) else: print (" here")
39.
What will be the output of the following code? i=1 while 1: if i%3==0: break print (i) i+=1
40.
Which of the following is the output of this program?i=1 while true: if i7==0: break print (i) i+=1
41.
What will be the output of the following Python code? i = 1 while true: if i%2==0: break print (i) i+=2
42.
Amongst which of the following is /are the conditional statement in python code?
43.
Which of the following expression value is correct?
44.
Which of the following is the output of this program? i=1 while false: if i%2==0: break print (i) i+=2
45.
What will be the output of the following Python code? for i in range (2.0): print(i)
46.
What will be output after execution of the following code? a= 11 b=5 if (a/ /b==2): print ( ' yes ') else : print (' no ')
47.
What will be the output of the following Python code? x=" abcdef" while i in x: print (i, end=" ")
48.
What will be the output after the following statements? for i in range (1,6):print (i , end='')if i==3: break
49.
Which amongst this is not a jump statement ?
50.
Which of the following is the output of this program?i=5 while true if i11==0 break print (i)i+=1