Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python programming

Total questions: 30

Worksheet time: 14mins

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.
How many times will this loop run?
a)
10
b)
9
c)
4
d)
5
4.

Which word completes this sentence: "Iteration makes code more ___________"

a)

Complex

b)

Efficient

c)

Simple

d)

Straightforward

5.

A FOR loop is....

a)

A COUNT controlled loop

b)

A CONDITION controlled loop

6.

A WHILE loop is....

a)

A COUNT controlled loop

b)

A CONDITION controlled loop

7.

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

8.

What is a programming language?

a)

Written English

b)

An artificial language used to program a computer

c)

A language used in pseudocode

d)

Machine code

9.

What does the print command do?

a)

Outputs a hard copy of a program to a printer

b)

Outputs a message on screen

c)

Print a hard copy of a flow chart to a printer

d)

Prints out the the commands line by line on the screen

10.

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

a)

string

b)

integer

c)

float

d)

boolean

11.

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

a)

integer

b)

float

c)

string

d)

boolean

12.

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?")

13.

What is a statement?

a)

A calculation performed in a programming language

b)

A box in a flow chart

c)

A keyword in a programming language

d)

A printout of the program

14.

How many statements are in this line of code?

print("If I do well in computing, I will find most subjects easy")

a)

2 - print and if

b)

0 - there are no statements

c)

1 - print

15.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

name

c)

"Dave"

d)

(name)

16.

What is a input?

a)

To plug in something

b)

A function that allows us to ask the user to enter some data

c)

Data displayed on a screen

d)

A routine

17.

A variable must have been assigned (given) a value before that value is referenced (used).

a)

True

b)

False

18.

To display the following on screen Hello World! the following command should be used:

a)

print(Hello World!)

b)

print("Hello World" + !)

c)

print("Hello World!")

d)

print"(Hello World!)"

19.

You assign a value to a variable with which symbol

a)

@

b)

==

c)

=

d)

*

20.

The code you use to receive and input from the keyboard

a)

enter()

b)

add()

c)

receive()

d)

input()

21.

Program statements are executed in sequence, one after the other...

a)

True

b)

False

22.

If the coding steps are in the incorrect order, the computer can still execute the program.

a)

True

b)

False

23.

Python (TM) is owned and managed by

a)

Microsoft (c)

b)

Sun Microsystems (c)

c)

Python (TM) is open source and free to use

d)

Google (c)

24.

Generally speaking, a low level programming language is easier to read, write and maintain over a high level programming language

a)

True

b)

False

25.

A string

a)

carries out an action

b)

the elements of a command

c)

a collection of characters

d)

how elements in a commad are arranged

26.

What symbol comes before a comment?

a)

$

b)

>>

c)

#

d)

!

27.

An exception is

a)

the structure of form of the code

b)

the meaning of the characters and words in the code

c)

the statement that is missing from the instructions

d)

an event occurring during execution of a program which disrupts the flow of the program's instructions

28.

Debugging is

a)

how characters are arranged in a statement

b)

detecting or removing errors from a program

c)

removing viruses from a computer

d)

the meaning of each of the characters and symbols in the program

29.

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

30.

Which of these tests whether the variable x is the same as 'Hello'?

a)

x = "Hello"

b)

x != "Hello"

c)

x == "Hello"

d)

x <> "Hello"