Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1height = 1.75 | AA comma is used instead of a decimal point, so the value is not a valid floating point number. It should be 19.95. | |
| 2price = 19.95 | BStores a money amount as a floating point number with 2 decimal places | |
| 3An integer is a whole number with no decimal part, unlike a floating point number | CStores a floating point number, because the value has a decimal part | |
| 4Floating point numbers suit measurements that are not always whole numbers, such as a person's height in metres | D175 has no decimal part, so it is an integer. A height in metres stored as a float should be written like 1.75. | |
| 5price = 19,95 | Eheight = 1.62 | |
| 6height = 175 (stored as a float, in metres) | Fstudents = 28 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
float — A floating point number is a number with a decimal part, such as 1.75 or 19.95. It is used for measurements like height and for money, unlike an integer, which has no decimals.price = float("19.95")
print(price + 0.05)price = 19.9567
print(round(price, 2)) # 19.96height = 1.82
print(type(height))
# <class 'float'>age = 16
print(isinstance(age, int))weight = 62.5
print(isinstance(weight, float))