Back
+10 XP
Concept

Floats

Any number with a decimal point is a `float` (`3.14`, `-0.5`, `5.0`). Computers store decimals in binary, which leads to hilarious quirks:

python
print(0.1 + 0.2)  # Prints: 0.30000000000000004

# 14. Floats Any number with a decimal point is a `float` (`3.14`, `-0.5`, `5.0`). Computers store decimals in binary, which leads to hilarious quirks: ```python print(0.1 + 0.2) # Prints: 0.30000000000000004 ``` Don't panic. That tiny `.0000000000000004` at the end is just how all computer hardware does decimal math.

Checkpoint

What type of number is `10.0`?

Practice

Create a float variable `price = 19.99` and print it with a label `"Price:"`.

Terminal
01
Tap code blocks below to assemble
Available Blocks