Set 1 PWP
Set 1 PWP
i = 1
while True:
if i % 3 == 0:
break
print(i, end=" ")
i += 1
a) 1 2 3
b) error
c) 1 2
d) none of the mentioned
3. What will be the output of the following Python code snippet if x = 1?
x << 2
a) 4
b) 2
c) 1
d) 8
7. What will be the output of the following Python expression if x = 56.236?
print("%.2f" % x)
) 56.236
a
b) 56.23
c) 56.0000
d) 56.24
9. What will be the output of the following Python code snippet?
for i in [1, 2, 3, 4][::-1]:
print(i, end=' ')
a) 4 3 2 1
b) error
c) 1 2 3 4
d) none of the mentioned
) 5
a
b) 8
c) 2
d) 1
11. What will be the output of the following Python statement? "a" + "bc"
a) bc
b) abc
c) a
d) bca
18. Which of the following Python statements will result in the output: 6?
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
a) A[2][1]
b) A[1][2]
c) A[3][2]
d) A[2][3]
) error
a
b) 1 2 3 4
c) a b c d
d) 0 1 2 3
20. What will be the output of the following Python code snippet?
z = set('abc$de')
print('a' in z)
) Error
a
b) True
c) False
d) No output