211
216
1024
512
What will be the output of the following ?
import mathprint(math.fact(5))
120
25
1,2,3,4,5
Error
1
8
True
False
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
find the output of following code:
import mathprint(math.fabs(-3.4))
-3.4
3.4
4.3
3
0
10
1.0
9
7
6
continue
check
range
break
4.0 + float(3)
5.3 + 6.3
5.0 + 3
3 + 7
What will be the output of following code
import mathprint(math.pi)
5.354562653589793
3.141592653589793
7.867564234556778
9.048495456553358
What will the following code output?
x=0if x: print("True")else: print("False")
None
//
?
<
and
55
60
555
What will be the output of the following Python code?
i = 2while True: if i%3 == 0: break print(i) i += 2
2 4 6 8 10 …
2 4
2 3
error
What will be the output of the following Python expression?
print(4.00/(2.0+2.0))
1.00
What is the output of following Python code?
>>print(5*(2//3))
3.3
[4,6]
[1, 2, 3, 4]
Error in Code
What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
5
4.0
4
16
32
x = 'abcd'for i in range(len(x)): print(i)
a b c d
0 1 2 3
1 2 3 4
What will be the output of the following expression ?
print (7//2)print (-7//2)
3 -3
4 -4
3 -4
3 3
11
Exponential
Addition
Multiplication
Parentheses
+5
-11
+11
-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
What does the following code print ?
if 2 + 5 == 8: print("TRUE")else: print("FALSE")print("TRUE")
TRUE
TRUE FALSE
TRUE TRUE
FALSE TRUE
1.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
1 2 3 4 5
x = 2for i in range(x): x += 1 print (x)
0 1 2 3 4 …
3 4
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
k^1
k**1
k^ ^1
k^*1
a=5;b=7 b=a print(a,” ”,b)
5 7
7 5
5 5
7 7
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
Infinite Loop
sqrt
rhombus
add
Sub
a=b,b=a
a,b=b,a
a=b;b=a
a=b and b=a
for i in range(2.0): print(i)
0.0 1.0
0 1
12.5
9.8
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
x = 'abcd'for i in range(len(x)): i.upper()print (x)
27.2
29.0
14.9
12.3
a=5 a*=10 print(a)
50
20.0
20
40.0
40
4.5
%
/
||
pass
None of These
a=55 b=’55’ print( a is not b)
TypeError
; (semicolon)
,(Comma)
: (colan)
None of these
100
-100
-101
101