wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

for num in range(10):

print(num)

a)

1 2 3 4 5 6 7 8 9 10

b)

0

1

2

3

4

5

6

7

8

9

c)

1

2

3

4

5

6

7

8

9

10

d)

0 1 2 3 4 5 6 7 8 9 10

2.

What is the "for" loop used for ?

a)

To print a string

b)

To print a number

c)

iterating over a sequence

d)

To print a list

3.

What are the three parameters in Python "for" loop ?

a)

(start, stop, step)

b)

(step, stop, start)

c)

(start, step, stop)

d)

None of the above

4.

Which is used to store multiple items in a single variable.

a)

variable

b)

for loop

c)

Lists

d)

string

5.

subjects = ['Maths','English','Science','Social','Tamil']

What is the index of last item "Tamil"

(a)  

6.

Which one is not a list function ?

a)

append()

b)

insert()

c)

pop()

d)

delete()

7.

What is the starting value of range() function by default ?

a)

1

b)

0

c)

-1

8.

What is the output ?

a)

b)

c)

9.

In a list, which method is used to add the elements at the end ?

a)

add()

b)

insert()

c)

append()

10.

b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

What if we slice the list ?

b[3:8]

a)

[4, 5, 6, 7, 8]

b)

[0 , 1 , 2 , 3 , 4 , 5, 6, 7, 8]

c)

[0 , 1 , 2 , 3 , 4]

d)

[5, 6, 7, 8]