11
8
1
0
What will be the output of the following Python statement?
print(chr(ord('A')+32))
A
B
a
Error
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
<<
**
|
%
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
#
=
/
&
4
5
infinite
ZeroDivisionError
What will the following code output?
a=555 b=55 print( b in a)
True
False
55
TypeError
Yes
No
if / else not used in python
None of the above.
What will be the value of the following Python expression?
print(float(4+int(2.39)%2))
5.0
4.0
10
x=0if x: print("True")else: print("False")
None
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
continue
check
range
break
sqrt
rhombus
add
Sub
id(x) == id(y)
len(x) == len(y)
x == y
all of these
for i in range(2.0): print(i)
0.0 1.0
0 1
none of the mentioned
3
6
4.0 + float(3)
5.3 + 6.3
5.0 + 3
3 + 7
7
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
n=5 while n>0: n-=1 if n==2: continue print(n,end=' ')
5 4 3 1 0
4 3 1 0
4 3 2
none of these
16
32
64
None of These
Type Casting
Data Transformation
Type modification
Variable Shifting
^
!
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
x = 'abcd' for i in range(len(x)): x = 'a' print(x)
abcd abcd abcd
a a a a
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
1.5
Exponential
Addition
Multiplication
Parentheses
*
<
==
Selection
Sequential
Simple
Loop
asc()
ord()
asci()
ascii()
x = 'abcd'for i in range(x): print(i)
a b c d
0 1 2 3
int
bool
float
9
a=b=c=1
a,b,c=1
a, b, c = 1, "python", 1.5
None of the above
x = ['ab', 'cd'] for i in x: x.append(i.upper()) print(x)
[‘AB’, ‘CD’]
[‘ab’, ‘cd’, ‘AB’, ‘CD’]
[‘ab’, ‘cd’]
Infinite Loop
pass
What is the output of following Python code?
>>print(5*(2//3))
3.3
i = 2while True: if i%3 == 0: break print(i) i += 2
2 4 6 8 10 …
2 4
2 3
getAscii()
get_ascii()
a=55 b=’55’ print( a is not b)
27.2
29.0
14.9
12.3
nested if
if..else
else if
if..elif
a=5 a*=10 print(a)
50
unichr (x)
oct (x)
chr(x)
None of the these
Can't say
None of these