2/28
Part 1 of 7 · Floats to centsLearn and do

Floats can't hold most amounts of money

The amounts in this problem are dollars, such as 0.29. Before any table, check how Python stores them.

0.1 + 0.2 is not 0.3

print(0.1 + 0.2)
print(0.1 + 0.2 == 0.3)
Predict

What do 0.1 + 0.2 and 0.1 + 0.2 == 0.3 print?

Pick one to see what it prints.
Pick an answer above to see the rest
Predict

Decimal(0.1) prints the exact value Python stored for 0.1. Is it above or below 0.1?

Pick one to see what it prints.
Pick an answer above to see the rest