wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

How many spaces is an indentation?

a)

2 spaces

b)

3 spaces

c)

4 spaces

d)

5 spaces

2.

What will it print?

a)

num 8

b)

num8

c)

8

d)

nothing

3.

How many errors are there in this code?

a)

1

b)

2

c)

3

d)

4

4.

Where can a global var be used? Select all that apply.

a)

They can be used inside a loop

b)

They can be used in a function

c)

They can be used in a conditional

d)

They can be used only in a function.

5.

Why is an indentation used in functions?

a)

to make it look cool

b)

to indicate the name of the function

c)

to indicate the block of code in a function

d)

to make it indented

6.

What will be the result?

a)

3

256

512

b)

256

1

512

c)

1

512

256

d)

512

256

3

7.

What will be the answer?

a)

23 89

b)

112

c)

xy

d)

x + y

8.

Who created python?

a)

Just Van Rossum

b)

James Gosling

c)

Guido Van Rossum

d)

Monty Python

9.

What type of variable is cricket?

a)

string

b)

float

c)

number

d)

tuple

10.

What do " " mean in python?

a)

They are used to create numbers

b)

They are a math operator in python

c)

They are used to make the code attractive

d)

They are used to string objects