wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python-quiz2

Total questions: 11

Worksheet time: 11mins

Name
Class
Date
1.

What will be the output of the following Python code?

a)

a) 1

2

3

b)

b) error

c)

c) 1

2

d)

d) none of the mentioned

2.

What are the values of the following Python expressions?

2**(3**2)

(2**3)**2

2**3**2

a)

a) 512, 64, 512

b)

b) 512, 512, 512

c)

c) 64, 512, 64

d)

d) 64, 64, 64

3.

What will be the output of the following Python program?

a)

a) error

b)

b) 0 1 2 0

c)

c) 0 1 2

d)

d) none of the mentioned

4.

What will be the output of the following Python code?

a)

a) 1 2 3 4 5 6

b)

b) 1 2 3 4 5 6 7

c)

c) error

d)

d) none of the mentioned

5.

What will be the output of the following Python code?

a)

a) 1

b)

b) 1 3 5 7.....

c)

c) 1 2 3 4..... .

d)

d) none of the mentioned

6.

What will be the output of the following Python code?

a)

a) a b c d

b)

b) 0 1 2 3

c)

c) error

d)

d) none of the mentioned

7.

What will be the output of the following Python code?

a)

a) a b c d

b)

b) 0 1 2 3

c)

c) error

d)

d) 1 2 3 4

8.

What will be the output of the following Python code?

a)

a) 0 1 2

b)

b) a b c

c)

c) {0: 'a', 1: 'b', 2: 'c'}

{0: 'a', 1: 'b', 2: 'c'}

{0: 'a', 1: 'b', 2: 'c'}

d)

d) none of the mentioned

9.

What will be the output of the following Python code?

for i in range(0):

print(i)

a)

a) 0

b)

b) no output

c)

c) error

d)

d) none of the mentioned

10.

What will be the output of the following Python code snippet?

a)

a) 0 1 2 3 4 …

b)

b) 0 -2

c)

c) 0

d)

d) error

11.

What will be the output of the following Python code?

a)

a) 0 1 2 3 4 Here

b)

b) 0 1 2 3 4 5 Here

c)

c) 0 1 2 3 4

d)

d) 1 2 3 4 5