wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

End of Topic Assessment - Python

Total questions: 30

Worksheet time: 3600secs

Name
Class
Date
1.

Read the Python program:

When this program is executed, what will be displayed on the screen?

a)

"I live in", location

b)

"I live in", "Leeds"

c)

I live in location

d)

I live in Leeds

2.

Read the Python program:


When this program is executed, what will be displayed on the screen, as a result of executing line 3?

a)

I’ve never been to and whatever the user has typed at the keyboard

b)

I’ve never been to location

c)

I’ve never been to input()

d)

It is not possible to know the output without executing the program.

3.

Read the Python program:

When this program is executed, what will be displayed on the screen?

a)

The Answer is 3 + 13 * 3

b)

The Answer is 42

c)

The Answer is 48

d)

The Answer is answer

4.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

13 42

b)

42 13

c)

a b

d)

There is an error in the program because variables a and b are not assigned values in the right order.

5.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

13 42

b)

42 13

c)

There is an error in the program because variables a and b are not assigned values in the right order.

d)

There is an error in the program because when line 1 is executed, variables a and b have not been assigned values.

6.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

13 42

b)

13 13

c)

42 13

d)

42 42

e)

There is an error in the program because when line 4 is executed, variable b no longer has a value.

7.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

13 14

b)

13 a+1

c)

a b

d)

There is an error in the program because when line 3 is executed, variable a no longer has a value.

8.

Read the Python program:


When this program is executed, what will be displayed on the screen, as a result of executing line 3?

a)

13

b)

26

c)

13 26

d)

Line 3 will not be executed because there is an error in line 2: print cannot display expressions such as 2*a.

9.

Read the Python program:


When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?

a)

You should try a little Python too

b)

Hello Pythonista

c)

You should try a little Python too

Hello Pythonista

d)

Hello Pythonista

You should try a little Python too

e)

There is an error in the program, because there should not be any quotes around "Python" in line 3.

10.

Read the Python program:


When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?

a)

You should try a little Python too

b)

Hello Pythonista

c)

You should try a little Python too

Hello Pythonista

d)

Hello Pythonista

You should try a little Python too

e)

There is an error in the program, because there should not be any quotes around "Python" in line 3.

11.

Read the Python program:


When this program is executed, what will be displayed on the screen if the user enters 0 at the prompt?

a)

0 is positive

0 is negative

b)

0 is positive

c)

0 is negative

d)

The program will not display anything because 0 is neither positive nor negative.

12.

Read the Python program:


When this program is executed, what will be displayed on the screen, if the user enters 0 at the prompt?

a)

0 is zero

0 is non-zero

b)

0 is zero

c)

0 is non-zero

d)

There is a syntax error in the condition in line 3.

13.

Read the Python program:


When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt?

a)

90 minutes is 1.5 hours

b)

90 minutes is less than an hour

c)

90 minutes is less than an hour

90 minutes is 1.5 hours

d)

There is a syntax error in the condition in line 3.

14.

Read the Python program:


When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt?

a)

90 minutes is 1.5 hours

b)

90 minutes is less than an hour

c)

90 minutes is less than an hour

90 minutes is 1.5 hours

d)

There is a syntax error in the condition in line 3.

15.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

Nothing will be displayed on the screen.

b)

13

c)

13

zero

d)

13

zero

0

16.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

There is an error in the program because when line 1 is executed, variable number has not been assigned a value.

b)

Nothing will be displayed on the screen.

c)

13

zero

d)

13

0

17.

Read the Python program:


When this program is executed, what will be displayed on the screen?

a)

small

b)

medium

c)

medium

large

d)

large

18.

Read the Python program:


How many times will line 3 be executed?

a)

None (the condition in line 2 will be False the first time it is checked)

b)

1

c)

3

d)

4

e)

Infinitely (the condition in line 2 will never become False)

19.

Read the Python program:


How many times will line 3 be executed?

a)

None (the condition in line 2 will be False the first time it is checked)

b)

1

c)

2

d)

3

e)

Infinitely (the condition in line 2 will never become False)

20.

Read the Python program:


How many times will line 4 be executed?

a)

None (the condition in line 2 will be False the first time it is checked)

b)

1

c)

10

d)

It is impossible to determine in advance

e)

Infinitely (the condition in line 2 will never become False)

21.

Read the Python program:


When this program is executed, what will be displayed on the screen, as a result of executing line 5?

a)

10

b)

1

c)

It is impossible to determine in advance

d)

There is an error in the program, because line 5 should have been indented

22.

Read the Python program:


When this program is executed, how many times will line 4 be executed?

a)

Line 4 will be executed once.

b)

Line 4 will be executed at least once.

c)

Line 4 will be executed 1357 times.

d)

Line 4 will be executed an infinite number of times (the while loop will never terminate).

23.

Read the Python program:


When this program is executed, how many times will line 4 be executed?

a)

Line 4 will be executed once.

b)

Line 4 will be executed at least once.

c)

Line 4 will be executed 1357 times.

d)

Line 4 will be executed an infinite number of times (the while loop will never terminate).

24.

Read the Python program:


When this program is executed, what will be displayed on the screen after line 6 is executed and the user types 1357 on the keyboard?

a)

Wrong pin, try again

b)

Wrong pin, try again

Welcome

c)

Welcome

d)

Wrong pin, try again

Enter pin

25.

A set of precise instructions that is meant to solve a problem is (a)   .

26.

The instructions in an algorithm ___________.

a)

can be expressed in any language

b)

can be expressed in any language, as long as they are precise

c)

can only be expressed using a programming language

d)

can only be expressed using binary digits

27.

The instructions in an algorithm, when expressed precisely in English, ______________.

a)

can only be carried out by humans

b)

can only be carried out by computers

c)

can be carried out by both humans and computers

28.

The instructions in a program, when expressed in Python, _______________.

a)

can only be carried out by humans, as long as they understand Python

b)

can only be carried out by computers

c)

can be carried out by computers, as long as an interpreter is available

d)

can be carried out by humans, as long as they understand Python, and computers, as long as an interpreter is available

29.

The instructions in a program ____________.

a)

can be expressed in any language

b)

can be expressed in any language, as long as they are precise

c)

can only be expressed using a programming language

d)

can only be expressed using binary digits

30.

A Python program requires ___________ to be executed.

a)

a computer

b)

a program called ‘the Python translator’

c)

a program called ‘the Python interpreter’

d)

a program called ‘a development environment’