wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Year 8 | Intro to Python | Quiz 1

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a program?

a)
A program is a type of hardware.
b)

A program is a set of instructions expressed in a programming language.

c)
A program is a user interface design.
d)
A program is a computer's memory.
2.

What is an algorithm?

a)
A recipe for cooking a meal.
b)
A random guess about a problem.
c)
A collection of data without any steps.
d)

An algorithm is a step-by-step set of instructions for solving a problem.

3.

Is a recipe an example of a program or an algorithm?

a)

Algorithm

b)

Program

4.

In programming what is a variable?

a)

A variable is a name for a storage location that can hold a value and may change during program execution.

b)
A variable is a command that executes a specific task in a program.
c)
A variable is a type of function that performs calculations.
d)
A variable is a fixed value that cannot be changed during program execution.
5.

Which version of a print() statement will run?

a)
print('Hello, World!')
b)

print("Hello, World!")

c)

PRINT("Hello, World!")

d)

Print('Hello World!'

6.

What does the = sign mean in the following line of code:

name = "Brett"

?

a)

Name is equal to Brett

b)

Brett is being saved to the name variable

c)

"Brett" is being saved to the name variable

d)

Brett is equal to name

7.

What key command word do we use if we want the user to enter data?

a)

print()

b)

if

c)

input()

d)

output()

8.

Which of the following is a valid variable name in most programming languages?

a)

1variable

b)

variable_name

c)

variable-name

d)

variable name

9.

What does print() do in Python?

a)
The print() function executes a loop in Python.
b)
The print() function compiles code in Python.
c)
The print() function displays output to the console.
d)
The print() function saves output to a file.
10.

What is wrong with the following code?

a)
The code is perfectly fine and requires no changes.
b)

The code does not need a comma.

c)

The code is missing a bracket.

d)

The code is missing it's speech marks

11.

What is wrong with the following code?

a)

Input is spelt wrong

b)

Missing speech marks

c)

Missing brackets

d)

Two words for the variable name

12.

How many errors are in this piece of code?

a)

1

b)

2

c)

3

d)

4

13.

Identify the correct line of code to fix all the errors.

a)

print"Hello, name)

b)

print("Hello, name)

c)

print("Hello", name)

d)

PRINT("Hello, name")

14.

Identify the variable

a)

name

b)

print

c)

Mrs Malaney

d)

Hello

15.

On which line is the variable declared?

a)

1

b)

2