How to read an error message in any programming language
A 3-step method for reading any error in Python, JavaScript, Java and SQL: find what went wrong, where, and which value caused it. With real output.
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.
A 3-step method for reading any error in Python, JavaScript, Java and SQL: find what went wrong, where, and which value caused it. With real output.
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.
Why SQLite says misuse of aggregate COUNT(), why PostgreSQL says a column must appear in the GROUP BY clause, why SQLite sometimes gives a wrong answer with no error at all, and how WHERE and HAVING differ.
Why a CSS rule does nothing: the stylesheet isn't loaded, the selector doesn't match, a missing semicolon, an invalid value, another rule wins, the order, or an inline element. Each one tested in a browser.
What Java's NullPointerException means, how to read the message that says which value was null, and the four places beginners usually meet it, with the fix for each. With code you can run.
What Python's IndentationError: expected an indented block (after 'if', 'for' or a function definition) means, how to fix it, plus unexpected indent, unindent does not match and TabError. With code you can run.
A plain comparison for beginners: what Python, JavaScript, SQL and Java are used for, the same small program written in all four, the myths that hold people back, and how to choose in 20 minutes.
Fix Java's "incompatible types: String cannot be converted to int" (also shown with java.lang.String): nextLine() and Integer.parseInt, the nextInt() trap, and the related int to String, double, char and lossy conversion errors.
Why Python says unsupported operand type(s) for -, +, / or //: 'int' and 'str' (or 'str' and 'int'), why input() always gives you text, and how to fix it with int(). With code you can run.
Why SQLite says "no such column", how single quotes fix the usual cause, the four other causes (a typo, another table, an alias, an old table) and the errors that look alike. With a table you can run.
Why JavaScript says it cannot read addEventListener of null, the usual causes (a missing #, a script that runs too early, a class instead of an id, a shared script) and how to fix each one.
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