
Quiz
Reading the Scroll of Errors
When Python crashes, it prints a traceback: the trail of function calls that led to the error. Don't panic. Read it from the bottom up:
- The last line names the error type and gives a message.
- The line just above it shows where it happened.
- Lines further up show who called that code.
Here's one from the Guild's star-counting program:
Traceback (most recent call last):
File "main.py", line 7, in <module>
print(average([]))
File "main.py", line 3, in average
return total / len(numbers)
ZeroDivisionError: division by zero