wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Final Revision G7_2T

Total questions: 44

Worksheet time: 25mins

Name
Class
Date
1.

Which of the following keywords marks the begining of the function block?

a)

Func

b)

define

c)

def

d)

function

2.

What is a piece of code that can take inputs to perform a certain task?

a)

a function

b)

arguments

c)

parameters

3.

Consider the line of code:

Label('Go Team', 200, 100)

What is the Label?

a)

argument

b)

parameter

c)

function name

4.

Which of the following items are present in the function header?

a)

Function name only

b)

Both function name and parameter list

c)

parameter list only

d)

Return value

5.

Which of the following terms best describes the code above?

a)

function call

b)

function definition

6.

Look at the following code, what will it generate

a)

1,2,3,4,5,6,7,8,9,10,11,12

b)

0,1,2,3,4,5,6,7,8,9,10,11,12

c)

1,2,3,4,5,6,7,8,9,10,11,12,13

d)

0,1,2,3,4,5,6,7,8,9,10,11,12,13

7.

What does the following program display?

a)

1,2,3,4

b)

1,2,3,4,5

c)

counter,counter,counter,counter,counter

d)

0,1,2,3,4,5

8.
a)
b)
c)
d)

1,2,3,4

9.

#What is the output?

a)

1,2,3,4,5

b)

0,1,2,3,4

c)

1,2,3,4

d)

5,4,3,2,1

10.

#How many hallos will be printed?

a)

5

b)

None

c)

4

d)

6

11.
How many times does the following program print the word ‘computer’:

word= "computer"  
for num in range(1,6):
 
    print(word)
a)
5
b)
6
c)
1
d)
0
12.
What is iteration known as?
a)
Looping
b)
Crashing
c)
Repeating
13.

Which of the following programs prints ten lines?

a)

for i in range(10):

print("hi")

b)

for i = 1 to 10:

print("hi")

c)

for i in 1 - 10:

print("hi")

d)

for i from 0 to 9:

print("hi")

14.

What will this code do?

a)

Print Numbers 1-11

b)

Print Numbers 1-10

c)

Print Numbers 2-10

d)

Print Error

15.

Lists are used to store single item in a single variable.

a)

True

b)

False

16.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
17.

What is the word (command) used to input text?

a)
print
b)
input
c)
output
d)
command
18.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
19.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
20.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
21.
Data type for a whole number
a)
String
b)
Integer
c)
Boolean
d)
Float
22.
Which two statements are used to implement iteration?
a)
IF and WHILE
b)
ELSE and WHILE
c)
FOR and WHILE
d)
IF and ELSE
23.

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

24.

A condition is

a)

a statement that is either True or False

b)

a string

c)

an integer

d)

a list

25.

Which of the following for loops would print the following numbers?

3

5

7

9

a)

for i in range(3, 10, 2):

print(i)

b)

for i in range(3, 9, 2):

print(i)

c)

for i in range(9):

print(i)

d)

for i in range(3,9):

print(i)

26.
stores a piece of data, and gives it a specific name
a)
variable
b)
whitespace
c)
interpreter
d)
modulo
27.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
28.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
29.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
30.
To solve a problem that requires the user to enter 10 numbers would use what type of iteration?
a)
While loop
b)
For loop
c)
Variable
d)
Selection
31.
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
32.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
33.
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
34.
In python the ' BOOLEAN data type' can be defined as...?
a)
holds alphanumerical data
b)
holds whole numbers
c)
holds a number with a decimal point
d)
holds either true or false
35.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
36.

Which of the following code is a Python Comment?

a)

#this is a comment

b)

{ this is a comment }

c)

" this is a comment "

d)

( this is a comment )

37.

The statement input allows us to:

a)

input values to the code

b)

Read what the user typed

c)

order the imported statements

d)

show there name

38.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
39.

Is the following statement True of False?

Boolean variables can be used as conditions in an IF statement.

a)

True

b)

False

40.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
41.
This operator means that one value is the same as the other value
a)
==
b)
!=
c)
>
d)
<
42.
This operator means that one value is not equal to another value
a)
==
b)
<=
c)
>=
d)
!=
43.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

44.

In Python, what are if-statements used for?

a)

Looping

b)

Indexing

c)

Decision Making

d)

Testing