wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python

Total questions: 14

Worksheet time: 10mins

Name
Class
Date
1.

Which of these is an array?

a)

fruit = ["apples", "oranges", "bananas"]

b)

fruit = "apples", "oranges", "bananas"

c)

fruit = {"apples", "oranges", "bananas"}

d)

fruit = ("apples", "oranges", "bananas")

2.

What is the position of the name 'Paula' in the following array:

names = ["Paul","Phillip","Paula","Phillipa"]

a)

0

b)

1

c)

2

d)

3

3.

The number or word we give to a variable

a)

Bug

b)

Text

c)

Information

d)

Value

4.

What is the word (command) used to output data?

a)

print

b)

input

c)

output

d)

command

5.

What is a variable?

a)

Part of the operating system that controls where data is stored.

b)

Hardware to store data on.

c)

A location in memory to store data that can be changed.

d)

A location in memory to store data that can't be changed.

6.
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
7.
Python is an example of a....
a)
Text-based programming language
b)
Object orientated programming language
c)
language written in java script
d)
Visual-based programming language
8.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
9.

In programming, what is iteration?

a)

The repetition of steps within a program

b)

The order in which instructions are carried out

c)

A decision point in a program

d)

Testing a program to make sure it works

10.
Why is iteration important?
a)
It determines the order in which instructions are carried out
b)
It allows code to be simplified by removing duplicated steps
c)
It allows multiple paths through a program
d)
It ensures the code works correctly
11.
Which two statements are used to implement iteration?
a)
IF and WHILE
b)
ELSE and WHILE
c)
FOR and WHILE
d)
IF and ELSE
12.

FOR loops are

a)

loops which run an unknown number of times

b)

loops which run for a specific number of times

c)

the same as if statements

d)

not part of programming

13.

WHILE loops are

a)

loops which run an unknown number of times

b)

loops which run for a specific number of times

c)

the same as if statements

d)

not part of programming

14.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI