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
error
1 2 3 4
55
60
555
Error
What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
5
4.0
4
0
1
11
10
Type Casting
Data Transformation
Type modification
Variable Shifting
What will be the output of the following Python code snippet?
x = 'abcd' for i in range(len(x)): x = 'a' print(x)
a
abcd abcd abcd
a a a a
none of the mentioned
15
150
200
i = 0while i < 3: print(i) i += 1else: print(0)
0 1 2 3 0
0 1 2 0
0 1 2
True
False
None
for i in range(int(2.0)): print(i)
0.0 1.0
0 1
for
while
Both A and B
None of the above
x = 2for i in range(x): x += 1 print (x)
0 1 2 3 4 …
3 4
for i in range(2.0): print(i)
What does the following code print ?
if 2 + 5 == 8: print("TRUE")else: print("FALSE")print("TRUE")
TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
What will be the output of the following expression ?
x =4print(x<<2)
16
6
2
infinite
ZeroDivisionError
What will be the output of the following Python statement?
print(chr(ord('b')+1))
b
c
A
8
8.0
find the output of following code:
import mathprint(math.fabs(-3.4))
-3.4
3.4
4.3
3
Identifier
Expression
Syntax
Task
[10, 8, 6]
[9, 7, 5]
[6, 8, 10]
[5, 7, 9]
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
x = "abcdef"i = "a"while i in x: print(i, end = " ")
no output
i i i i i i …
a a a a a a …
a b c d e f
Infinite
NULL
k^1
k**1
k^ ^1
k^*1
print(4+2**5//10)
7
77
asc()
ord()
asci()
ascii()
What will the following code output?
a,b,c=3,5,6 b,c,a=a,b,c print(a,” ”,b,” ”,c)
3 5 6
6 3 5
5 6 3
6 5 3
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))
from math import*print(floor(3.7))
3.0
None of These
What value does the following expression evaluate to ?
print(5 + 8 * ((3*5)-9)/10)
9.0
9.8
10.0
Selection
Sequential
Simple
Loop
What will be the value of X in the following Python expression?
x = 2+9*((3*12)-8)/10
30.0
30.8
28.4
27.2
false
ValueError occurs
TypeError occurs
unichr (x)
oct (x)
chr(x)
None of the these
18
None of these
211
216
1024
512
*
**
<
==
30
25
20
50
id(x) == id(y)
len(x) == len(y)
x == y
all of these
1.5
20.0
28
28.0
print (7//2)print (-7//2)
3 -3
4 -4
3 -4
3 3
What will be the output of the following pseudocode, where ^ represent XOR operation ?
Integer a, b, cset b = 4, a = 3c =a ^ bPrint c
[4,6]
[1, 2, 3, 4]
Error in Code
abc=2,00,000
a,b,c=200,300,400
a_b_c= 2,00,000
abc=200 300 400
range(0,3,1)
range(1,4,1)
range(1,3)
range(1,3,0)