for
while
Both A and B
None of the above
What will be the output of the following Python code snippet?
x = 2for i in range(x): x += 1 print (x)
0 1 2 3 4 …
3 4
0
error
27.2
29.0
14.9
12.3
What will be the output of the following ?
import mathprint(math.fact(5))
120
25
1,2,3,4,5
Error
What will be the output of the following Python code?
x = 'abcd'for i in range(len(x)): print(i.upper())
a b c d
0 1 2 3
1 2 3 4
What will the following code output?
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 value does the following expression evaluate to ?
print(5 + 8 * ((3*5)-9)/10)
9.0
9.8
10
10.0
4.0 + float(3)
5.3 + 6.3
5.0 + 3
3 + 7
What is the output of the following code?
count=0while count<3: print(count,end=" ") count+=1
0 1 2
1 2 3
What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
5
4.0
4
4.5
float(‘10’)
int(‘10’)
float(’10.8’)
int(’10.8’)
i = 1while True: if i%2 == 0: break print(i) i += 2
1
1 2
1 2 3 4 5 6 …
1 3 5 7 9 11 … infinite time
Selection
Sequential
Simple
Loop
What will be the output after the following statements?
a = 0b = 3while a + b < 8: a += 1 print(a, end='')
0 1 2 3 4
1 2 3 4 5 6
1 2 3 4 5
None of these
12.5
8
9
What does the following code print ?
if 2 + 5 == 8: print("TRUE")else: print("FALSE")print("TRUE")
TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
Yes
No
if / else not used in python
None of the above.
The truncated decimal part of a number
The rounded integer value of a number.
The truncated integer value of a number.
The floor (largest integer less than or equal to the number).
(1,3)
(2,5)
(2,1)
(4,8)
i = 1while True: if i%7 == 0: break print(i) i += 1
1 2 3 4 5 6 7
none of the mentioned
x = 'abcd'for i in range(len(x)): print(i)
*
**
<
==
#
=
/
&
x = "abcdef"while i in x: print(i, end=" ")
a b c d e f
abcdef
i i i i i i …
[0, 2, 4]
[1, 3, 5]
[0, 1, 2, 5]
[0, 5, 2]
What is the output of the following ?
print(int())
Any Random Number
nested if
if..else
else if
if..elif
a=b=c=1
a,b,c=1
a, b, c = 1, "python", 1.5
for i in range(int(2.0)): print(i)
0.0 1.0
0 1
id(x) == id(y)
len(x) == len(y)
x == y
all of these
Break stops the execution of entire program
Break halts the execution and forces the control out of the loop
Break forces the control out of the loop and starts the execution of next iteration
Break halts the execution of the loop for certain time frame
True
False
or
equal
and
not
print(4+2**5//10)
3
7
77
|
^
!
x = 'abcd'for i in range(x): print(i)
Arithmetic or Relational expression
Arithmetic or Logical expression
Relational or Logical expression
Arithmetic
5.5
3.5
x = "abcdef"i = "a"while i in x: print(i, end = " ")
no output
a a a a a a …
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 0 1 0 2
from math import powprint(math.pow(2,3))
Nothing is printed
Error, method pow doesn’t exist in math module
Error, the statement should be: print(pow(2,3))
asc()
ord()
asci()
ascii()
6
Infinite
NULL
int
bool
float
None
a=b,b=a
a,b=b,a
a=b;b=a
a=b and b=a
Compiler
Interpreter
Assembler
65536
33
169
break
pass
continue
None of These