WorksheetsJ277 - 10QQ - Basic Python 1
Total questions: 10
Worksheet time: 7mins
Name
Class
Date
1.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
2.
Constants cannot be changed.
a)
True
b)
False
3.
Which of the following is a data type in Python? Select multiple answers.
a)
int
b)
words
c)
string
d)
decimals
4.
What would be printed by the command
print('12-5')
a)
12-5
b)
'12-5'
c)
7
d)
'7'
5.
Converts a number to a string
a)
str()
b)
int()
c)
parseInt()
d)
convert
6.
Which of these values would be useful as a constant?
a)
Pi
b)
Di
c)
Ni
d)
Pie
7.
A variable has a label (It's name) and a (a) address.
8.
In order to convert an input from a string into an integer, you have to (a) it.
9.
What will the below code output?
cost = 2.5
quantity = 10
total = cost * quantity
print(total)
(a)
10.
What goes in the space to make the code run?
cost = 2.5
quantity = 10
total = cost * quantity
print("Your total is £" + (a) (total))
100 %
