Font size
WorksheetsYear 9 Python Basics Term 1 assessment
Total questions: 25
Worksheet time: 13mins
What is a variable used for in Python?
To store data
To print text
To delete files
To draw shapes
Which symbol is used to assign a value to a variable?
==
=
!=
<>
Which of these is a number?
'hello'
True
5
[1, 2, 3]
Which of these is a string?
5
'hello'
True
[1, 2, 3]
Which of these is a list?
[1, 2, 3]
'list'
True
5
How do you print something in Python?
show()
print()
display()
output()
What does the + operator do with numbers?
Adds them
Subtracts them
Multiplies them
Divides them
What does the + operator do with strings?
Adds them
Joins them
Deletes them
Multiplies them
Which of these is a correct list?
[1, 2, 3]
(1, 2, 3)
{1, 2, 3}
<1, 2, 3>
How do you get the first item in a list called my_list?
my_list[0]
my_list(0)
my_list{0}
my_list<0>
What does True mean in Python?
Yes
No
Error
Nothing
Which of these is a boolean value?
True
'True'
5
[True]
How do you add something to a list?
list.add()
list.append()
list.insert()
list.push()
What does len() do?
Adds numbers
Counts items
Deletes items
Prints items
Which of these is a correct variable name?
my_var
2var
var-name
var name
What is the result of 3 * 2?
6
5
3
9
What is the result of 10 / 2?
5.0
5
2
10
What is the result of 10 % 3?
1
3
0
10
Which function changes a number to a string?
str()
int()
float()
bool()
Which function changes a string to a number?
int()
str()
float()
bool()
What does == mean in Python?
Equal to
Assign
Not equal
Greater than
What does != mean in Python?
Not equal
Equal
Assign
Less than
Which symbol is used for comments?
#
//
--
/*
What is the result of 'Hi' + ' there'?
Hi there
Hi+there
Error
Hi there
What is the result of True and False?
False
True
Error
None
