WorksheetsIntroduction to Python Programming
Total questions: 40
Worksheet time: 3hrs 16mins
When this program is executed, what will be displayed on the screen?
"I live in", location
"I live in", "Leeds"
I live in location
I live in Leeds
When this program is executed, what will be displayed on the screen, as a result of executing line 3?
I've never been to and whatever the user has typed at the keyboard
I've never been to location
I've never been to input()
It is not possible to know the output without executing the program.
When this program is executed, what will be displayed on the screen?
The Answer is 3 + 13 * 3
The Answer is 42
The Answer is 48
The Answer is answer
When this program is executed, what will be displayed on the screen?
13 42
42 13
a b
There is an error in the program because variables a and b are not assigned values in the right order.
When this program is executed, what will be displayed on the screen?
13 42
42 13
There is an error in the program because variables a and b are not assigned values in the right order.
There is an error in the program because when line 1 is executed, variables a and b have not been assigned values.
When this program is executed, what will be displayed on the screen?
13
42
13 42
There is an error in the program because variable a cannot hold two values at the same time.
When this program is executed, what will be displayed on the screen?
13 42
13 13
42 13
42 42
When this program is executed, what will be displayed on the screen?
13 14
13 a+1
a b
There is an error in the program because when line 3 is executed, variable a no longer has a value.
When this program is executed, what will be displayed on the screen? Note: There may be errors in the program and/or it may not behave as expected.
13
14
13 14
There is an error in the program because there are no values for variable a that could be used in the equation in line 3.
When this program is executed, what will be displayed on the screen?
14
43
14 43
There is an error in the program because variable b cannot hold two values at the same time.
When this program is executed, what will be displayed on the screen?
13
26
13 26
Line 3 will not be executed because there is an error in line 2: print cannot display expressions such as 2*a.
When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?
You should try a little Python too
Hello Pythonista
You should try a little Python too Hello Pythonista
There is an error in the program, because there should not be any quotes around "Python" in line 3.
When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?
You should try a little Python too
Hello Pythonista
You should try a little Python too Hello Pythonista
Hello Pythonista You should try a little Python too
There is an error in the program, because there should not be any quotes around "Python" in line 3.
When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?
You should try a little Python too
Hello Pythonista
You should try a little Python too Hello Pythonista
There is an error in the program, because there should be quotes around Python in line 3.
When this program is executed, what will be displayed on the screen, if the user enters Python at the prompt?
You should try a little Python too
Hello Pythonista
Nothing will be displayed on the screen
There is an error in the program, because there is no else.
You should try a little Python too Hello Pythonista
When this program is executed, what will be displayed on the screen if the user enters 0 at the prompt?
0 is positive
0 is negative
0 is negative
The program will not display anything because 0 is neither positive nor negative.
0 is positive
When this program is executed, what will be displayed on the screen, if the user enters 0 at the prompt?
0 is zero
0 is non-zero
0 is non-zero
There is a syntax error in the condition in line 3.
0 is zero
When this program is executed, what will be displayed on the screen, if the user enters 30 at the prompt?
30 minutes is 0.5 hours
30 minutes is less than an hour
30 minutes is less than an hour
30 minutes is 0.5 hours
There is a syntax error in the condition in line 3
When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt?
90 minutes is 1.5 hours
90 mi
90 minutes is less than an hour
90 minutes is 1.5 hours
There is a syntax error in the condition in line 3.
When this program is executed, what will be displayed on the screen, if the user enters 90 at the prompt? Note: There may be errors in the program and/or it may not behave as expected.
90 minutes is 1.5 hours
90 minutes is less than an hour
90 minutes is less than an hour
90 minutes is 1.5 hours
There is a syntax error in the condition in line 3.
When this program is executed, what will be displayed on the screen?
Nothing will be displayed on the screen.
zero
13
0
13
0
zero
When this program is executed, what will be displayed on the screen?
Nothing will be displayed on the screen.
13
13
zero
13
aero
0
When this program is executed, what will be displayed on the screen?
There is an error in the program because when line 1 is executed, variable number has not been assigned a value.
Nothing will be displayed on the screen.
13
zero
13
zero
0
When this program is executed, what will be displayed on the screen?
small
medium
medium
large
large
When this program is executed, what will be displayed on the screen?
small
medium
medium
large
large
How many times will line 3 be executed?
None (the condition in line 2 will be False the first time it is checked)
1
3
4
Infinitely (the condition in line 2 will never become False)
How many times will line 3 be executed?
None (the condition in line 2 will be False the first time it is checked)
1
3
4
Infinitely (the condition in line 2 will never become False)
How many times will line 3 be executed?
None (the condition in line 2 will be False the first time it is checked)
1
3
4
Infinitely (the condition in line 2 will never become False)
How many times will line 3 be executed?
None (the condition in line 2 will be False the first time it is checked)
1
2
3
Infinitely (the condition in line 2 will never become False)
How many times will line 4 be executed?
None (the condition in line 2 will be False the first time it is checked)
1
10
It is impossible to determine in advance
Infinitely (the condition in line 2 will never become False)
When this program is executed, what will be displayed on the screen, as a result of executing line 5?
10
1
It is impossible to determine in advance
There is an error in the program, because line 5 should have been indented
When this program is executed, how many times will line 4 be executed?
Line 4 will be executed once.
Line 4 will be executed at least once.
Line 4 will be executed 1357 times.
Line 4 will be executed an infinite number of times (the while loop will never terminate).
When this program is executed, how many times will line 4 be executed?
Line 4 will be executed once.
Line 4 will be executed at least once.
Line 4 will be executed 1357 times.
Line 4 will be executed an infinite number of times (the while loop will never terminate).
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?
Wrong pin, try again
Wrong pin, try again
Welcome
Welcome
Wrong pin, try again
Enter pin
A set of precise instructions that is meant to solve a problem is_______________.
a computer
an algorithm
a program
an interpreter
The instructions in an algorithm___________________ .
can be expressed in any language
can be expressed in any language, as long as they are precise
can only be expressed using a programming language
can only be expressed using binary digits
The instructions in an algorithm, when expressed precisely in English,__________________.
can only be carried out by humans
can only be carried out by computers
can be carried out by both humans and computers
The instructions in a program, when expressed in Python,_______________ .
can only be carried out by humans, as long as they understand Python
can only be carried out by computers
can be carried out by computers, as long as an interpreter is available
can be carried out by humans, as long as they understand Python, and computers, as long as an interpreter is available
The instructions in a program________________.
can be expressed in any language
can be expressed in any language, as long as they are precise
can only be expressed using a programming language
can only be expressed using binary digits
A Python program requires______________to be executed.
a computer
a program called 'the Python translator'
a program called 'the Python interpreter'
a program called 'a development environment'
