Craftstack Academy

Real errors, explained

The error messages beginners really get in Python, JavaScript, SQL and Java: what each one means, why it happens and how to fix it. Every example was run, and every message is copied from the real output.

Python

Why does 0.1 + 0.2 not equal 0.3 in Python?

Why Python prints 0.30000000000000004 for 0.1 + 0.2, why 0.1 + 0.2 == 0.3 is False, and the three fixes: round for display, math.isclose() instead of ==, and Decimal for money. With code you can run.

· 4 min read

Get stuck on an error like these?

Twenty minutes with the AI tutor, right in your browser. It reads your real code and output, and hints instead of handing you the answer.

Start the free trial
A session: the tutor's chat on the left, the code editor with a Java program and its output on the right