NEW
Font size
WorksheetsPython
Total questions: 13
Worksheet time: 7mins
What do we use variables for?
To store data
Print data
Produce functions
Evaluate
5 * 3 ** 2 + 3
33
48
Error
What would be printed to the screen?
x, y, z = "Orange", "Banana", "Cherry"
print(z)
Orange
Banana
Cherry
Orange, Banana, Cherry
What will be printed to the screen?
x = 5
y = "John"
print (x + y)
5 + John
Syntax error - you cannot add str and int together
John
JohnJohnJohnJohnJohn
In the following code, what value will be assigned to the variable "cat"?
mouse, cat, dog = "small", "medium", "large"
small, medium, large
small
medium
large
Nothing, that operation will throw an error
In python the ' boolean' data type can be defined as...?
holds alphanumerical data
holds whole numbers
holds a number with a decimal point
holds either true or false
print(9>2 and 6<=6)
TRUE
FALSE
When a program RUNS but does not do what you expect, it means that your program contains...?
A logic error
A syntax error
When a program does not run, it will be because of....
A logic error
A syntax error
What are the different data types in Python?
Monday, Tuesday, Wednesday
Apple, banana, orange
The different data types in Python include integer, float, string, boolean, list, tuple, dictionary, etc.
Red, blue, green
What is the difference between int and float data types in Python?
int is used for decimal numbers while float is used for whole numbers
int and float are the same data type in Python
The main difference between int and float data types in Python is that int is used for integer values (whole numbers) while float is used for decimal or floating-point numbers.
int is used for strings while float is used for numbers
