NEW
Font size
WorksheetsYear 10s quiz
Total questions: 20
Worksheet time: 20mins
Which of the following is NOT a valid variable name in Python?
_student
123_hey
first_name
studentMark
If you want to make sure a variable is an integer, you could use...
int(variable)
variable(int)
integer(variable)
variable_integer
The '+' operator in Python can be used to...
Add numbers only
Combine strings only
Add numbers or combine strings
None of these options
The command to output information in Python is...
echo()
tell()
print()
return()
The 'elif' keyword is short for...
Elephants Like Interesting Facts
Else If
Evaluate If
Alternatively If
Nested 'If' statements are...
Not possible in Python
A type of function
'If' statements that only run when another 'if' statement is true
'If' statements inside 'why' statements
Which of the following is NOT a valid Python data type?
String
Integer
Float
Brackets
'==' is used in Python for...
Assigning a value to a variable)
Checking if something equals something else
Both assigning a value and checking equality
None of these answers are correct
If myVariable == "500", what is the type of myVariable?
String
Integer
Float
Boolean
What is the output of the following code?
geoff = 12
print(type(geoff))
12
<class 'str'>
<class 'int'>
<class 'float'>
What would this code output?
print('Hello' + 'World')
HelloWorld
Hello World
Hello+World
Hello + World
What would the following code output?
bobsAge = "5" + "7"
print(bobsAge)
57
12
5+7
"5"+"7"
What's the best way to indent code in Python?
Use the return key
Use brackets
Use the shift key
Use the tab key
What would this code print?
mySum = 7 * 2
print(mySum)
14
9
5
7 * 2
What would print here?
gamePrice = "5.99"
gamePrice = float(gamePrice)
print(type(gamePrice))
"5.99"
String
<class 'int'>
<class 'float'>
What will this code do?
jamesSport = "Football"
print(Football)
It'll print 'Football'
Nothing
It'll generate an error
It'll print the variable name jamesSport
What prints here?
Lion
Tiger
Crocodile
Alligator
What values can the Boolean data type have?
FALSE
TRUE or FALSE
TRUE, FALSE or UNKNOWN
TRUE
Is there Icecream today?
today = "Wednesday"
if (today == "Thursday" and 1 > 2) or ("blue" == "blue"):
print("Icecream today!")
Yes
No
I don't know
No, but there should be
What will be printed?
age = 14
if not(age > 16):
print("You are too young to drive")
else:
print("You can drive")
You are too young to drive
You can drive
An error will occur
Nothing will be printed
