wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Year 10s quiz

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

Which of the following is NOT a valid variable name in Python?

a)

_student

b)

123_hey

c)

first_name

d)

studentMark

2.

If you want to make sure a variable is an integer, you could use...

a)

int(variable)

b)

variable(int)

c)

integer(variable)

d)

variable_integer

3.

The '+' operator in Python can be used to...

a)

Add numbers only

b)

Combine strings only

c)

Add numbers or combine strings

d)

None of these options

4.

The command to output information in Python is...

a)

echo()

b)

tell()

c)

print()

d)

return()

5.

The 'elif' keyword is short for...

a)

Elephants Like Interesting Facts

b)

Else If

c)

Evaluate If

d)

Alternatively If

6.

Nested 'If' statements are...

a)

Not possible in Python

b)

A type of function

c)

'If' statements that only run when another 'if' statement is true

d)

'If' statements inside 'why' statements

7.

Which of the following is NOT a valid Python data type?

a)

String

b)

Integer

c)

Float

d)

Brackets

8.

'==' is used in Python for...

a)

Assigning a value to a variable)

b)

Checking if something equals something else

c)

Both assigning a value and checking equality

d)

None of these answers are correct

9.

If myVariable == "500", what is the type of myVariable?

a)

String

b)

Integer

c)

Float

d)

Boolean

10.

What is the output of the following code?

geoff = 12

print(type(geoff))

a)

12

b)

<class 'str'>

c)

<class 'int'>

d)

<class 'float'>

11.

What would this code output?

print('Hello' + 'World')

a)

HelloWorld

b)

Hello World

c)

Hello+World

d)

Hello + World

12.

What would the following code output?

bobsAge = "5" + "7"

print(bobsAge)

a)

57

b)

12

c)

5+7

d)

"5"+"7"

13.

What's the best way to indent code in Python?

a)

Use the return key

b)

Use brackets

c)

Use the shift key

d)

Use the tab key

14.

What would this code print?

mySum = 7 * 2

print(mySum)

a)

14

b)

9

c)

5

d)

7 * 2

15.

What would print here?

gamePrice = "5.99"

gamePrice = float(gamePrice)

print(type(gamePrice))

a)

"5.99"

b)

String

c)

<class 'int'>

d)

<class 'float'>

16.

What will this code do?

jamesSport = "Football"

print(Football)

a)

It'll print 'Football'

b)

Nothing

c)

It'll generate an error

d)

It'll print the variable name jamesSport

17.

What prints here?

a)

Lion

b)

Tiger

c)

Crocodile

d)

Alligator

18.

What values can the Boolean data type have?

a)

FALSE

b)

TRUE or FALSE

c)

TRUE, FALSE or UNKNOWN

d)

TRUE

19.

Is there Icecream today?

today = "Wednesday"

if (today == "Thursday" and 1 > 2) or ("blue" == "blue"):

print("Icecream today!")

a)

Yes

b)

No

c)

I don't know

d)

No, but there should be

20.

What will be printed?

age = 14

if not(age > 16):

print("You are too young to drive")

else:

print("You can drive")

a)

You are too young to drive

b)

You can drive

c)

An error will occur

d)

Nothing will be printed