What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
5
4.0
4
What will be the output of the following expression ?
x =4print(x<<2)
16
6
2
; (semicolon)
,(Comma)
: (colan)
None of these
What will be the output of the following Python expression?
print(4.00/(2.0+2.0))
Error
1.0
1.00
1
211
216
1024
512
Yes
No
if / else not used in python
None of the above.
15
150
200
10
Testing
Indentation
Debugging
None of the above
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 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
1 2 3 4 5
What will be the output of the following Python code?
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
Compiler
Interpreter
Assembler
skip
continue
break
pass
32
7
3
id(x) == id(y)
len(x) == len(y)
x == y
all of these
None of These
What will be the output of the following Python statement?
print(chr(ord('A')+32))
A
B
a
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
=
!=
<>
=!
~
|
&
^
What will the following code output?
a=55 b=’55’ print( a is not b)
True
False
55
TypeError
x = "abcdef"i = "a"while i in x: print(i, end = " ")
a a a a a a …
20.0
20
40.0
40
int
bool
float
None
8
What will be the output of the following expression
x=14print(x>>2)
14
What will be the output of the following Python code snippet?
print(not(3>4))print(not(1&1))
True True
True False
False True
False False
asc()
ord()
asci()
ascii()
x = 'abcd'for i in range(x): print(i)
a b c d
0 1 2 3
error
none of the mentioned
a=5;b=7 b=a print(a,” ”,b)
5 7
7 5
5 5
7 7
[10, 8, 6]
[9, 7, 5]
[6, 8, 10]
[5, 7, 9]
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
What will be the output of following code
import mathprint(math.pi)
5.354562653589793
3.141592653589793
7.867564234556778
9.048495456553358
switch
foreach
Nested Loop
Infinite
NULL
a=b=c=1
a,b,c=1
a, b, c = 1, "python", 1.5
0
for i in range(2.0): print(i)
0.0 1.0
0 1
+5
-11
+11
-5
x = 'abcd'for i in range(len(x)): i.upper()print (x)
4.5
x = "abcdef" i = "a" while i in x: print('i', end = " ")
i i i i i i … infinite Time
What is the output of the following ?
print(int())
Any Random Number
find the output of following code:
import mathprint(math.fabs(-3.4))
-3.4
3.4
4.3
Arithmetic or Relational expression
Arithmetic or Logical expression
Relational or Logical expression
Arithmetic
What is the output?
x = 5print(bool(x))
false
ValueError occurs
TypeError occurs
What value does the following expression evaluate to ?
print(5 + 8 * ((3*5)-9)/10)
9.0
9.8
10.0
27.2
29.0
14.9
12.3