Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Review

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

what is the variable name in this code?

a)

print

b)

if

c)

secret

d)

password

2.
Look at this code, what shape will it make?
a)
Square
b)
Triangle
c)
Rectangle
d)
Hexagon 
3.
What is wrong with this code?
a)
Missing Brackets
b)
Missing Comma
c)
Missing Colon
d)
Incorrect spelling 
4.

What operation is correct for the given condition?

7 __ 5

a)

<

b)

>

c)

<=

d)

>=

e)

==

5.

What operation is correct for the given condition?

5 __ 5

Select all that apply.

a)

<

b)

>

c)

<=

d)

>=

e)

==

6.

Which statement is correct?

a)

If the water level is reached, then turn off the motor. If the water level is not reached, then measure the level and repeat the sequence.

b)

If the water level is reached, then measure the level. If the water level is not reached, then turn off the motor.

c)

If the water level is reached, then turn off the motor. If the water level is not reached, then turn off the motor.

d)

If the water level is reached, then measure the level. If the water level is not reached, then measure the level and repeat the sequence.

e)

If the water level is reached, then turn off the motor. If the water level is not reached, then measure the level.

7.

What will the monitor display?

a)

The is the if body.

This is outside the if block.

b)

The is the if body.

c)

This is outside the if block.

d)

error

8.

The clock reads 11 PM.

What will be the result?

a)

I am going to sleep.

b)

I am going to do my math homework.

c)

I am going to get started.

d)

error

9.

What are the variables? Check all that apply.

a)

Number

b)

Name

c)

B

d)

Print

10.

What name goes with the value 25?

a)

Number

b)

Name

c)

B

d)

Print

11.

What name goes with the value 3.5?

a)

Number

b)

Name

c)

B

d)

Print

12.

Which reassignment of variables is correct?

a)

Name = "Henry"

print (num)

b)

Name = "Henry"

print ("Henry")

c)

Name = "Stephanie"

print (Name)

d)

Name = "Stephanie"

print (name)

13.

What is the value for the name x?

a)

x

b)

y

c)

z

d)

SoftwareTestingHelp

14.

What is the value for the name x?

a)

x

b)

y

c)

z

d)

SoftwareTestingHelp

15.

What is the value for the name y?

a)

x

b)

y

c)

z

d)

SoftwareTestingHelp

16.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
17.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
18.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
19.

Code for Hello, World!

a)

print Hello, World!

b)

print("Hello, World!)

c)

print("Hello, World!")

20.

Python has a simple syntax similar to the

a)

coding language

b)

english language

c)

spanish language