wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

GBIC Unit2 Lesson5 Assessment

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.
a)

"I live in", location

b)

"I live in", "Leeds"

c)

I live in location

d)

I live in Leeds

2.
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.
a)

The Answer is 3 + 13 * 3

b)

The Answer is 42

c)

The Answer is 48

d)

A.                  The Answer is answer

4.
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 proper order

5.
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 proper 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.
a)

13

b)

42

c)

13 42

d)

There is an error in the program because variable a cannot hold two values at the same time.

7.
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.

8.
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.

9.
a)

13

b)

14

c)

13 14

d)

There is an error in the program because there are no values for variable a that will satisfy the equation in line 3.

10.
a)

14

b)

43

c)

14 43

d)

There is an error in the program because variable b cannot hold two values at the same time.

11.
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

12.
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.

13.
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

14.
a)

should try a little Python too

b)

Hello Pythonista

c)

You should try a little Python too

Hello Pythonista

d)

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

15.
a)

should try a little Python too

b)

Hello Pythonista

c)

You should try a little Python too

Hello Pythonista

d)

Nothing will be displayed on the screen

e)

There is an error in the program, because there is no else

16.
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

17.
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.

18.
a)

30 minutes is 0.5 hours

b)

30 minutes is less than an hour

c)

30 minutes is less than an hour

30 minutes is 0.5 hours

d)

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

19.
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.

20.
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.

21.
a)

Nothing will be displayed on the screen.

b)

zero

c)

13

0

d)

13

0

zero

22.
a)

Nothing will be displayed on the screen.

b)

13

c)

13

zero

d)

13

zero

0

23.
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

zero

0

24.
a)

small

b)

medium

c)

medium

large

d)

large

25.
a)

small

b)

medium

c)

medium

large

d)

large

26.
a)

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

b)

1

c)

3

d)

4

e)

Infinite (the condition in line 2 will never become False).

27.
a)

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

b)

1

c)

3

d)

4

e)

Infinite (the condition in line 2 will never become False).

28.
a)

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

b)

1

c)

3

d)

4

e)

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

29.
a)

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

b)

1

c)

2

d)

3

e)

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

30.
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)

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

31.
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.

32.
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)

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

33.
a)

Line 4 will be executed once.

b)

Line 4 will be executed at least once.

c)

Line 4 will be executed 1,357 times.

d)

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

34.
a)

Wrong pin, try again

b)

Wrong pin, try again

Welcome

c)

Welcome

d)

Wrong pin, try again

Enter pin

35.

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

a)

a computer

b)

an algorithm

c)

a program

d)

an interpreter

36.

The instructions in an algorithm                             .

a)

any can be expressed in 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

37.

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

38.

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

39.

Q1   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

40.

A Python program requires                              to execute it.

a)

a computer

b)

a program called ‘the Python translator’

c)

a program called ‘the Python interpreter’

d)

a program called ‘a development environment’