switch
foreach
Nested Loop
None
What will the following code output?
x=0if x: print("True")else: print("False")
True
False
Error
What is the output of following code
print( 5 in 515)
TypeError
ValueError
n=5 while n>0: n-=1 if n==2: continue print(n,end=' ')
5 4 3 1 0
4 3 1 0
4 3 2
none of these
Entry Controlled Loop
Exit Controlled Loop
Both of the above
None of the above
7
8
10
6
skip
continue
break
pass
a=55 b=’55’ print( a is not b)
55
What value does the following expression evaluate to ?
print(5 + 8 * ((3*5)-9)/10)
9.0
9.8
10.0
What will be the output of the following expression ?
x =4print(x<<2)
4
16
2
4.5
4.0
unichr (x)
oct (x)
chr(x)
None of the these
0
1
11
int
bool
float
directs the order of execution of the statements in the program
dictates what happens before the program starts and after it terminates
defines program-specific data structures
manages the input and output of control characters
60
555
for
assert
while
if
a=b=c=1
a,b,c=1
a, b, c = 1, "python", 1.5
+
*
**
//
What is the output of the following program:
i = 0while i < 3: print (i) i=i+1 print (i+1)
0 2 1 3 2 4
0 1 2 3 4 5
Infinite loop
0 1 2 3
What will be the output of the following Python code?
i = 1while True: if i%7 == 0: break print(i) i += 1
1 2 3 4 5 6
1 2 3 4 5 6 7
error
none of the mentioned
for i in range(5): if i == 5: break else: print(i)else: print("Here")
0 1 2 3 4 Here
0 1 2 3 4 5 Here
0 1 2 3 4
1 2 3 4 5
:=
=
==
!=
Yes
No
Can't say
None of these
x = 'abcd'for i in range(len(x)): print(i.upper())
a b c d
1 2 3 4
Selection
Sequential
Simple
Loop
exit
What is the output of the following?
m=0while m<5: m+=1 if m==3: break else: print(0)
0 1 2 0
0 1 2
0 0 1 0 2
4.0 + float(3)
5.3 + 6.3
5.0 + 3
3 + 7
|
&
^
!
check
range
What will be the output of the following Python code snippet?
x = 'abcd' for i in range(len(x)): print(x) x = 'a'
a
abcd abcd abcd abcd
a a a a
x = 'abcd'for i in range(len(x)): print(i)
3
5
What will be the output after the following statements?
for i in range(1,6): print(i, end='') if i == 3: break
1 2
1 2 3
What will be the output of the following ?
import mathprint(math.fact(5))
120
25
1,2,3,4,5
Int
Float
int or float
8.0
#
/
x = 'abcd'for i in range(len(x)): i.upper()print (x)
generates a list of numbers, to iterate over with for loops
immediate exit from the innermost loop structure.
returned an iterator a sequence object.
Arranging numbers whether in ascending or descending order.
i = 1while True: if i%2 == 0: break print(i) i += 2
1 2 3 4 5 6 …
1 3 5 7 9 11 … infinite time
a,b,c=3,5,6 b,c,a=a+1,b+2,c+3 print(a,” ”,b,” ”,c)
7 9 4
4 7 9
9 4 7
What will be the value of the following Python expression?
print(4+2**5//10)
77
27
9
15
150
200
from math import*print(floor(3.7))
3.0
None of These
27.2
29.0
14.9
12.3
Arithmetic or Relational expression
Arithmetic or Logical expression
Relational or Logical expression
Arithmetic