WorksheetsYear 9 Python Review
Total questions: 19
Worksheet time: 10mins
name = 'Dave'
print (name)
What is the output from the following code?
print ("hello world")
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
What will happen when this code is run and the user types in yes?
It will print the following:
is it raining today?
yes
The code will return:
Better take a brolly
or you will get wet
Enjoy the weather
Is it windy today?
It will print the following:
is it raining today?
yes
The code will return:
Better take a brolly
or you will get wet
Is it windy today?
It will print the following:
is it raining today?
yes
The code will return:
Better take a brolly
or you will get wet
It will print the following:
is it raining today?
yes
The code will return:
Better take a brolly
Where is there an error in this code?
Line 2
No need for white space
Line 3
No need for ==
Line 8
There is no print instruction
Line 3 missing a colon ( : )
What does the operator != on line 3 represent
Is exactly
Is an integer
Is a statement
Is not
Which of the following is the operator used in Python to say less than or equal to
==
<=
>=
<
What does int mean as shown in line 2 and line 4 of the code?
It tells python to remember an input as a variable
It tells python that the user is going to input something
Integral - it tells python to integrate this line of code
Integer - it tells Python that a whole number will be input
This is code to calculate the price of tickets charged to customers. On which line of code is there an error?
Line 4
Line 5
Line 6
Line 8
