wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz Year 8

Total questions: 25

Worksheet time: 14mins

Name
Class
Date
1.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
2.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
3.

What will be the output of the following?

name = "Dave"

print (name)

a)

Dave

b)

"Dave"

c)

name

d)

(name)

4.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
5.

A syntax error could mean your code has a spelling mistake

a)
True
b)
False
6.

Which statement correctly assigns the string "Blue" to the variable name?

a)

name  = print( "Blue")

b)

input("Blue")

c)

name = "Blue"

d)

name = input("Blue")

7.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
8.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)

It displays an output

d)
It loops the code.
9.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
10.

What is the output from the following code?

print ("hello world")

a)
Hello World
b)
hello world
c)
print hello world
11.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

12.

What will be the output?

name = "Bob"

print ("name")

a)

Bob

b)

"Bob"

c)

name

d)

"name"

13.

What is a data type than can have one of two values: True or False

a)

boolean

b)

variable

c)

modulo

d)

interpreter

14.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
15.

Which of these functions could convert a number to a string

a)

str()

b)

int()

c)

parseInt()

d)

convert()

16.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
17.
What does INT means in python?
a)
Decimal Numbers
b)
Whole Number
c)
Text
d)
Floating Point Number
18.

To convert to a string, what would I use?

a)

str()

b)
int()
c)
parseInt()
d)
convert
19.

What is python named after....

a)
The snake
b)
Television show called Monty Python
20.

What data type would age in years be? e.g.24

a)

Integer

b)

Float

c)

Boolean

d)

String

21.

What data type would I use for the value of Pi? e.g. 3.1415

a)

Float

b)

Boolean

c)

Integer

d)

String

22.
How do you program an input from the user? 
a)
print
b)
variable = input()
c)
if
d)
else
23.

On which line is concatenation happening?

a)

Line 2

b)

Line 1

c)

There isn't any!

24.

What data type does Python automatically store the user's input as?

a)

String

b)

Float

c)

Integer

d)

Boolean

25.

What is casting in programming?

a)

Converting one data type into another

b)

Putting different types of data together

c)

Storing data permanently in memory

d)

Saving data so it’s not lost