Font size
WorksheetsGr 2 Assessment -Python Recap ModuleYear 9 (RM)
Total questions: 100
Worksheet time: 1hrs 9mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Which statement correctly assigns the string "Peter" to the variable name?
name = print( "Peter")
input("Peter")
name = "Peter"
name = input("Peter")
What is an example of a boolean?
"Hello!"
56
True/False
46.7
What is the output of the following code?
x = 5
y = 3
print(x + y)
8
2
15
7
Which function is used to get input from the user in Python?
input()
get_input()
read()
scan()
Which is the most appropriate data type for: "13th December"
String
Boolean
Float
Integer
print("12"*3)
What would this print?
121212
36
24
12*3
age = '5'
In the code above, age is a
string
integer
floating point
A variable that only contains whole numbers would be
A float
A string
An integer
A char
print(Hello world!)
Which statement prints I am 10 years old?
pint("I am 10 years old.")
print('I am 10 years old.)
print('')I am 10 years old.
print("I am 10 years old.")
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
The output of the program
x = 4
x = "Sally"
print(x)
four
Saly
Sally
Python language use
upper case letters
lower case letters
upper and lower case letters
What will code output?
Adult
Child
Teenager
Error
Which operator checks for equality in Python?
=
==
===
!=
In Python, 'elif' is short for:
else if
else information
either if
else in function
What will the code print?
Smaller
Greater
Error
Nothing
How do you read a user's input and store it in a variable named 'name'?
name = input("Enter your name: ")
input("Enter your name: ") -> name
name <- input("Enter your name: ")
get("Enter your name: ") as name
print("Hello" + "world" + "today")
Which python operator means 'less than or equal to'?
>=
>
<
<=
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
print(X)
Why won't this work?
a > b
a >= b
a <= b
a < b
Which is the python logo?
Top left
Bottom left
Top right
Bottom right
Arithmetic Operator
What is + ?
What is a * ?
What is a / ?
The result of this program:
Friday = False
if Friday:
print "Jeans day!"
else:
print "Uniform day"
Jeans day
Today is Friday
Uniform day
Not Friday
What in the name of the variable in this Python code?
name
input
("What is your name")
Which of these is not an arithmetic operator?
+
-
*
=
When coding in Python what two instructions would I use if I want the program to select a choice?
IF
IF
COUNT
IF
ELSE
IF
INPUT
Which command will correctly ask the user for their age?
age = input("How old are you?")
age = input(How old are you?)
input("How old are you?") = age
How old are you = input()
Which decision statement will be triggered if the variable x is less than 20?
if x > 20:
if x <> 20:
if x == 20:
if x < 20:
What would the output of this code be if the user entered the value 70?
Pass
Fail
Merit
Distinction
What is the output of this code?
5
10
15
Error
a = 10
b=5
b=a+5
print(b)
What would be printed to the screen in this example?
5
10
105
15
a = 10
b=5
b=a+5
print(a)
What would be printed to the screen in this example?
5
10
105
15
Code for
Five is greater than two!
if 5 > 2:
print("Five is greater than two!")
if 5 = 2:
print("Five is greater than two!")
if 5 > 2: Print("Five is greater than two!")
What data value would store the value: -9?
Float
Integer
String
Boolean
What data type would store the value: Oranges
String
Float
Boolean
Integer
What is the correct code to ask the user their favorite color?
input("What is your favorite color?")
question("What is your favorite color?")
print("What is your favorite color?")
ask("What is your favorite color?")
What is the difference between an input statement & a print statement?
They are the same code.
input displays answers.
print displays questions.
input displays an output on the console.
print accepts input from a user.
input accepts input from a user.
print displays an output on the console.
What is the output?
more than 7
more than 23
spam
7
What would be outputted here?
it divides by 7!
it divides by 3.
It divides by 7!
It divides by 3.
What is the correct term for this symbol?
" "
Quotation marks
Bunny fingers
Parenthesis
Exclamation mark
What is the output?
level 3
level 3
level 1
level 3
level 1
NIL
level 3
level 2
level 1
NIL
What statement will go into the label?
John is getting ice cream
John is getting apple juice
John is getting baby formula
John is getting nothing
The ‘else’ statement is optional in Python
TRUE
FALSE
There can be an else statement without an if statement
TRUE
FALSE
Which of these is used in Python to add a third, fourth, etc outcome to a scenario?
elif
else if
iff
elsa
john = 5 .
if john > 6: .
. print("John is getting ice cream")
else: .
. print("John is getting apple juice")
print("John is getting grapes") .
John is getting grapes
John is getting grapes
john = 10 .
if john > 6: .
. print("John is getting ice cream")
else: .
. print("John is getting apple juice")
print("John is getting grapes") .
John is getting grapes
John is getting grapes
What is the output?
more than 7
more than 23
spam
7
2 + 2 == 4
What is a % ?
Which is the correct operator for power(x^y)?
x^y
x**y
x^^y
None of the mentioned
name = "bungmanoon"
print(name)
price = 100
print(price)
"bungmanoon"
100
bungmanoon
100
bungmanoon
100
Select the correct answer:
x = 15
y = 4
print( 'x * y')
59
60
54
22
Select the correct answer:
x = 15
y = 4
print(x // y)
3
3.75
4
5
Logical operators:
True if both operands are true
x and y
x or y
not x
Logical Operators:
True if either of the operands is true
x and y
x or y
not x
What will be outputted?
number is bigger than 10
nothing
an error
NUMBER IS BIGGER THAN 10
The result of this program:
Friday = False
if Friday:
print "Jeans day!"
else:
print "Uniform day"
Jeans day
Today is Friday
Uniform day
Not Friday
Choose the correct data type:
-900
Character
String
Integer
Real/Float
Boolean
Choose the correct data type:
10500
Character
String
Integer
Real/Float
Boolean
Choose the correct data type:
0.25
Character
String
Integer
Real/Float
Boolean
Choose the correct data type:
240.00
Character
String
Integer
Real/Float
Boolean
Choose the correct data type:
The surname of a user
Example: Chapman
Character
String
Integer
Real/Float
Boolean
Choose the correct data type:
Height (in metres)
Example: 1.64
Character
String
Integer
Real/Float
Boolean
What will the output be from the following code?
print("Hello world!\nHello world!")
Hello world! Hello world!
Hello world!
Hello world!
SyntaxError
Hello world!
Which of the following would be an example of a string variable:
ValidInput = False
GuessCount = 100
Name = "Bilbo"
Pi = 3.14159265359
