wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming - Python (year 12)

Total questions: 21

Worksheet time: 10mins

Name
Class
Date
1.
Which python operator means 'less than or equal to'?
a)
>
b)
<
c)
>=
d)
<=
2.
What is another word for 'iteration'?
a)
Selection
b)
Variable Assignment
c)
Repetition
d)
Sequencing
3.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
4.

What is a program?

a)

A series of a step-by-step instructions that tell a computer how to solve a task

b)

A video that is watched on a computer

c)

A flowchart written on a computer

d)

The make and model of a computer

5.

How do we get user input from the keyboard?

a)

input = (What is your name?)

b)

input = What is your name?

c)

output = ("What is your name?")

d)

input("What is your name? ")

6.

Which data type is the most suited to store a telephone number in a variable?

a)

string

b)

integer

c)

float

d)

boolean

7.

Which data type would you use for the quantity of stock in a shop?

a)

integer

b)

float

c)

string

d)

boolean

8.

If you want to change the data type to an integer which line of code would you use?

a)

int ("How much pocket money do you have?")

b)

input("How much pocket money do you have?")

c)

int(input("How much pocket money do you have?"))

d)

int = ("How much pocket money do you have?")

9.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
10.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
11.
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
12.
Joining elements together to make a string is called what?
a)
Combining
b)
Connecting
c)
Concatenation
d)
Stringing
13.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
14.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
15.
What will the output be from the following code?
print("Hello" + str(2) + "world!")
a)
Hello world! Hello world!
b)
Hello2world!
c)
Hello Hello world! world!
d)
SyntaxError
16.

Will return True if a string only contains numbers

a)

isalpha()

b)

isnumeric()

c)

int()

d)

string()

17.

Will return True if all characters are alphabetic

a)

isalpha()

b)

isalnum()

c)

isdigit()

d)

lstrip()

18.

What does the % do in python?

a)

Returns the remainder

b)

Integer division

c)

Returns the percentage

d)

Real division

19.

What command is used to access a library of functions?

a)

import

b)

load

c)

get

d)

library

20.

What are the 3 programming constructs?

a)

input ,process, output

b)

sequence, selection, iteration

c)

variable, constant, value

d)

code, test, review

21.

What are the 3 types of programming errors?

a)

syntax, runtime, logic

b)

syntax, overflow, type

c)

runtime, overflow, class

d)

type, boundary, underflow