What will be the output of the following Python code?
x = "abcdef"i = "i"while i in x: print(i, end=" ")
no output
i i i i i i …
a b c d e f
abcdef
55
60
555
Error
What will be the output after following statements?
x = 2if x < 5: print(x)else: pass
2 3 4
1 2 3 4
2
None of These
i = 1while False: if i%2 == 0: break print(i) i += 2
1
1 3 5 7 …
1 2 3 4 …
Nothing will be printed
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
error
for i in range(0): print(i)
0
none of the mentioned
x = "abcdef"while i in x: print(i, end=" ")
What will be the output of the following Python statement?
print(chr(ord('b')+1))
a
b
c
A
Yes
No
Can't say
None of these
Infinite Loop
conditional loop
unlimited loop
i = 0while i < 5: print(i) i += 1 if i == 3: break else: print(0)
if / else not used in python
None of the above.
from math import powprint(math.pow(2,3))
Nothing is printed
8
Error, method pow doesn’t exist in math module
Error, the statement should be: print(pow(2,3))
What is the output of the following ?
print(int())
Any Random Number
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).
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
What does the following code will print ?
x=5if x>3: print("Hello")
Hello
Hello Hello
nothing
Hello Hello Hello Hello Hello
; (semicolon)
,(Comma)
: (colan)
Entry Controlled Loop
Exit Controlled Loop
Both of the above
None of the above
20.0
20
40.0
40
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
unichr (x)
oct (x)
chr(x)
None of the these
%
/
//
||
i = 1while True: if i%2 == 0: break print(i) i += 2
1 2
1 2 3 4 5 6 …
1 3 5 7 9 11 … infinite time
from math import*print(floor(3.7))
3
4
3.0
What does the following code print ?
if 2 + 5 == 8: print("TRUE")else: print("FALSE")print("TRUE")
TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
switch
foreach
Nested Loop
None
asc()
ord()
asci()
ascii()
True
False
What will be the output of following code
import mathprint(math.pi)
5.354562653589793
3.141592653589793
7.867564234556778
9.048495456553358
No Operation
No Action
Null Statement
Placeholder
Type Casting
Data Transformation
Type Conversion
Variable Shifting
Infinite
NULL
print(chr(ord('A')+32))
B
abc=2,00,000
a,b,c=200,300,400
a_b_c= 2,00,000
abc=200 300 400
211
216
1024
512
5
6
A*A=8
A*=8
A*8=A
A=*8
27.2
29.0
14.9
12.3
[4,6]
[1, 2, 3, 4]
10
Error in Code
What is the output of following Python code?
>>print(5*(2//3))
3.3
11
What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
4.0
for i in range(2.0): print(i)
0.0 1.0
0 1
range(0,5)
range(1,5)
range(1,4)
range(0,4)
for
While
do-while
0.0
1.0
a=b,b=a
a,b=b,a
a=b;b=a
a=b and b=a
for i in range(int(2.0)): print(i)
d = {0: 'a', 1: 'b', 2: 'c'}for x in d.values(): print(d[x])
a b c
0 a 1 b 2 c