Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SHS 8.4 Python

Total questions: 23

Worksheet time: 8mins

Name
Class
Date
1.

Notes in programs that the complier/interpreter ignore. In Python you write these using #

a)

Variable

b)

Comments

c)

While

d)

String

2.

A space in memory to store some information that can be used later on in a program. This stored information can change.

a)

Iteration

b)

while

c)

Variable

d)

for

3.

Categories that define what a variable can store e.g. Int, Str, Bool

a)

Boolean

b)

Data types

c)

Float

d)

String

4.

A category of variable combining letters and or numbers e.g. "ABCD" "Hello World 123"

a)

Concatenation

b)

String

c)

Mathematical operator

d)

Conditional statement

5.

A category of variable that stores whole numbers

a)

Float

b)

Input command

c)

String

d)

Integer or Int

6.

A category of variable for storing decimal numbers e.g. 1.2, 3.142, 0.673

a)

While

b)

Float

c)

Variable

d)

For

7.

A category of variable for storing true/false values

a)

if statement

b)

Boolean

c)

Assignment operators

d)

String

8.

A category of variable for storing multiple pieces of information in one variable.

a)

List

b)

Concatenation

c)

Logic error

d)

While

9.

This means to change a variables category e.g. changing int(123) to float(123.0)

a)

String

b)

Variable

c)

Cast/Casting

d)

Comments

10.

A way to get information into the computer when programming

a)

Iteration

b)

Input command

c)

While

d)

Output command

11.

A way to get information out of the computer when programming

a)

Concatenation

b)

Float

c)

Data type

d)

Output command

12.

To link or join things together. Like "gluing" strings together e.g. "Top" + "Hat" becomes "TopHat"

a)

Concatenation

b)

Variable

c)

Iteration

d)

While

13.

A function that can be performed on integers or floats. For example + - * / %

a)

for

b)

Mathematical operators

c)

While

d)

Iteration

14.

Used to assign values to variables e.g. =, +=, -=

a)

Assignment operators

b)

String

c)

Iteration

d)

For

15.

An statement that performs an action on the result of an operation. It can be thought of as yes/no, true/false

a)

Comments

b)

Conditional statements

c)

Variable

d)

Iteration

16.

How we deal with a conditional statement. For example: if rainingOutside = "yes" print("Take umbrella")

a)

Variable

b)

List

c)

if elif else

d)

Boolean

17.

Used with conditional statements if, elif, and else as all can result in true or false. e.g. ==, !=, >, <, >=, <=

a)

Comparison operators

b)

Iteration

c)

for

d)

While

18.

Used to combine conditional statements so they resolve to a single true or false statement e.g. AND OR NOT

a)

Logical operators

b)

Cast/Casting

c)

Input command

d)

Data types

19.

Means to do the same process over and over again in a loop

a)

Iteration

b)

Concatentation

c)

Boolean

d)

List

20.

A type of loop used in programming when we know how many times we want to iterate

a)

for

b)

while

c)

String

d)

float

21.

A type of loop used in programming when we do not know how many times we want to loop

a)

while

b)

for

c)

Input command

d)

Assignment operator

22.

A error in the written code. Like a spelling or grammatical error when writing a sentence.

a)

Syntax error

b)

Iteration

c)

String

d)

Variable

23.

When the code runs, but does not do what you expect. These kind of errors are harder to fix.

a)

Logic error

b)

Syntax error

c)

Conditional statements

d)

Comparison operator