WorksheetsPython quick quiz
Total questions: 10
Worksheet time: 7mins
Name
Class
Date
1.
What will be the output of the following code snippet?
print(2**2 + (5 + 6)**(1 + 1))
a)
129
b)
125
c)
8
d)
None of the Above
2.
What will be output if a = 8**2 and b =5
a = input()
b=input()
print(a +b)
a)
69
b)
21
c)
error
d)
8**25
3.
a)
Samar
b)
Error
c)
Global
d)
No Output
4.
What will be the output?
a)
[2, 5, 7, 19, 22, 45, 72, 89]
b)
(2, 5, 7, 19, 22, 45, 72, 89)
c)
Error
d)
{2, 5, 7, 19, 22, 45, 72, 89}
5.
s = {1, 2, 3.0, 3, 2, 4, 5, 5.0}
print(s)a)
{1, 2, 3, 4, 5.0}
b)
{1, 2, 3.0, 4, 5}
c)
{1, 2, 3.0, 4, 5.0}
d)
{1, 2, 3.0, 3, 2, 4, 5, 5.0}6.
a)
[0,1,4,9]
b)
[0,1,4,9,16]
c)
[0,1,4,9,16,25]
d)
[0,1,2,3,4]
7.
Guess output?
a)
1
b)
2
c)
3
d)
4
8.
How can you check if a key exists in a dictionary?
a)
a) Using the contains() method.
b)
b) Using the in keyword.
c)
c) Using the has_key() method.
d)
d) Using the get() method.
9.
x=range(3,10,4)
for i in x:
print(i)
# Guess the outputa)
3 7
b)
4 7
c)
3 4 5 6 7 8 9
d)
3 4 5 6 7 8 9 10
10.
a)
Year : 2023
Month : 6
Date 24b)
Year : 2023
Month : 6
Date 23c)
Year : 2023
Month : 6
Date 10d)
Error
100 %
