wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python - Programming Constructs - KS3 Y9

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which programming contruct, does the attached image represent?

a)

Sequence

b)

Selection

c)

Iteration/Loop

2.

Iteration/Loop is the repeated execution of a section of code when a program is running

a)

True

b)

False

3.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
4.
What command is this shape for?
a)
References another part of the program
b)
Data that is going in as input or coming out as output
c)
Processing something - a calculation or storing something into a variable
d)
Shows the direction of the program
5.
What is the difference between a flowchart and pseudocode? 
a)
A flowchart is diagramatic whilst pseudocode is written in a programming language (eg. Pascal or Java) 
b)
A flowchart is textual but pseudocode is diagrammatic 
c)
A flowchart is a diagrammatic description of an algorithm whilst pseudocode is a textual description of an algorithm 
d)
A flowchart and pseudocode are the same thing 
6.
What does this symbol mean?
<
a)
Greater Than
b)
Less Than
7.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
8.

What is the word (command) used to display output within Python?

a)

print

b)

input

c)

output

d)

display

9.

What is a variable?

a)

A box(memory location) where you store values

b)

A box(memory location) where you store multiple values

c)

Data type

d)

A static memory value

10.

A data type consisting of whole numbers.

a)

integer

b)

float / real

c)

string

d)

boolean

11.

Given the nested if-else structure below, what will be the value of x after code execution completes.

a)

2

b)

0

c)

3

d)

4

12.
To get the users input what function do we use?
a)
Input
b)
input<> 
c)
input() 
d)
INPUT()
13.
What three things make up an if statement?
a)
if, egg, else
b)
if, elif, else
c)
if, elif, egg
d)
if, excited, scream
14.
What is wrong with this code?

if answer == (“Man United”)
a)
no quotation marks
b)
no parentheses
c)
no capital letters
d)
No colon
15.
Converts a number to a string
a)
str()
b)
int()
c)
parseInt()
d)
convert