Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Code

Total questions: 11

Worksheet time: 8mins

Name
Class
Date
1.

Python code needs to be exact, what type of error will present if the code is not exact?

(a)  

2.

What is this code missing?

a)

int

b)

f string

c)

brackets

3.

Which function was used to display this code?

(a)  

4.

If a number is written like '3600', the code will believe that it is a word.

a)

True

b)

False

5.

Why does 'Take an umbrella' not print in this statement?

a)

The input doesn't match the if statement

b)

The code was wrong

c)

Because it isn't raining outside

d)

An else statement was required

6.

What will happen if you remove the if statement from the code?

a)

The code will not run

b)

The code will ask for input

c)

The code will print an error

d)

The code will always print the message

7.

Which of the following is necessary to check a condition in Python?

a)

if statement

b)

for loop

c)

print statement

d)

input function

8.

What will the code output if the input matches the if condition?

a)

It will ask for input again

b)

It will print the specified message

c)

It will print an error

d)

It will do nothing

9.

How many variables are in this question?

a)

2

b)

1

c)

3

d)

unlimited

10.

Read the code

If the following was inputted to the code, what would it print?

My dog loves to eat Cantaloupe!

(a)  

11.

If you typed bathroom into the input, what would the code respond with?

(a)