Skip to content
BENIBIX Learn

Error

Development🧩 Programming ConceptsErrors

Also known as Programming Error

A problem that stops code from working. Some stop it early, some mid-run.

Think of it like

Think of it like a smoke alarm going off. It tells you something is wrong and roughly where to look.

Example

Emma's program stops with ZeroDivisionError on line 2. The list of scores was empty, so it tried to divide by zero.

Why it matters

An error message is a clue, not a scolding. Reading it carefully is the fastest way to a fix.

Definition

An error is a problem that stops code from doing what it should. Some errors stop the code before it runs, like a missing bracket. Others happen while it runs, like dividing by zero. Some never stop the code at all and just give a wrong answer. A good error message names the problem and the line where it happened.

Example code

python
>>> 10 / 0
ZeroDivisionError: division by zero
The message names the kind of error and what went wrong.

Common mistake

Skipping the message and guessing. The last line usually says exactly what broke.

Key takeaways

  1. 1
    Three kinds. Before it runs, while it runs, or silent.
  2. 2
    Read the message. It names the problem and the line.
  3. 3
    A clue, not a fail. Every developer sees errors every day.

Learn it properly