wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

What does ~~~~~~10 evaluates to?

a)

+10

b)

6

c)

-10

d)

4

2.

_______ is simplest but incomplete version of function

a)

Stub

b)

Function

c)

Lambda

d)

The function made using Top-Down Approach

3.

What is the Output?

a)

{0: 1, 7:0, 1:1, 8:0}

b)

{1:1, 7:2, 0:1,8:1}

c)

{0:0, 7:0, 1:1, 8:1}

d)

Key Error

4.

What is the output?

a)

Dictionary comprehension doesn't exist

b)

{0:0, 1:1, 2:4, 3:9, 4:16, 5:25, 6:36}

c)

{0:0, 1:1, 4:4, 9:9, 16:16, 25:25}

d)

{0:0, 1:1, 2:4, 3:9, 4:16, 5:25}

5.

What is the output?

print( 'bcd'.partition('bcd') )

a)

('bcd')

b)

('')

c)

('bcd', ' ', ' ' )

d)

(' ', 'bcd', ' ')

6.

What Is The Output?

a)

49

b)

2

c)

51

d)

No Output

7.

What Is The Output?

a)

4

b)

Error

c)

1

d)

2

8.

What Is The Output?

a)

21

b)

12

c)

56

d)

12.5

9.

What will be the content of stack2 from TOP to BOTTOM after the execution of the below function?Consider Stack With Following Elements14,35, 22, 10, 5, 20

a)

10,20,10,70

b)

70,10,20,10

c)

50,20,10,70

d)

10,70,10,70

10.

What would be the values of the output queue from front to rear when the below input_queue is passed as input to given function? input_queue(front to rear) : 3,7,6,2,5,6,3,2

a)

3,6,13,3

b)

10,7,3

c)

10,7,3,2

d)

8,7,5