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
for
assert
while
if
do-while
a > b
b == 0
while (b != 0)
a == b
What will be the output of the following Python code?
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 following Python code?
>>print(5*(2//3))
3
3.3
0
error
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
=
!=
<>
=!
What will be the output of the following expression ?
print (7//2)print (-7//2)
3 -3
4 -4
3 -4
3 3
for i in range(0): print(i)
no output
none of the mentioned
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 value does the following expression evaluate to ?
x = 5while x < 10: print(x, end='')
Closed loop
one time loop
Infinite loop
Evergreen loop
Identifier
Expression
Syntax
Task
exit
continue
break
pass
-9
9
6
-6
What is the output of following code?
x = 1y = 2z = 3print(x < y < z == True)
True
False
None
30
25
20
50
x =4print(x<<2)
4
16
2
a=555 b=55 print( b in a)
55
TypeError
>=
<=
What will be the output of the following ?
import mathprint(math.fact(5))
120
1,2,3,4,5
Error
unichr (x)
oct (x)
chr(x)
None of the these
x = 'abcd'for i in range(x): print(i)
a b c d
0 1 2 3
print(5 + 8 * ((3*5)-9)/10)
9.0
9.8
10
10.0
What will be the output of the following Python expression?
print(4.00/(2.0+2.0))
1.0
1.00
int
bool
float
What will be the output of the following Python statement?
print(chr(ord('b')+1))
a
b
c
A
Selection
Sequential
Simple
Loop
|
&
~
^
11
+
//
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
Infinite Loop
What is the output of the following code?
for i in range(3): print(i,end=" ")
0 1 2
1 2 3
What will be the value of the following Python expression?
print(4+2**5//10)
7
77
Exponential
Addition
Multiplication
Parentheses
What is the output of following code
print( 5 in 515)
ValueError
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
[0, 2, 4]
[1, 3, 5]
[0, 1, 2, 5]
[0, 5, 2]
What is the output?
x = 5y = 10print(x > 3 or y < 5 and x == 5)
Yes
No
Can't say
None of these
range(0,5)
range(1,5)
range(1,4)
range(0,4)
print(True and False)
Testing
Indentation
Debugging
None of the above
While
count=0while count<3: print(count,end=" ") count+=1
not
or
and
xor
conditional loop
unlimited loop
?