ZeroDivisionError
The exception raised when a program divides by zero or takes a remainder by zero.
In more detail
It applies to /, // and %. Check the divisor first or catch the exception when zero is a possible input.
Related terms
- exception — An error object a program raises to stop normal flow and report that something went wrong.
- traceback — The report Python prints when an unhandled exception stops a program, listing the chain of calls that led there and ending with the error.
Taught in
- Exceptions: try, except, else, finally — Hands-on Python: Complete Video Course & Book
- Reading A Traceback Like A Professional — Hands-on Python: Complete Video Course & Book
- The Exception Family Tree — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Try, Except, Else And Finally — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Twelve Traps, One Shape Each — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Mock, Review And Exam Day — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Exceptions Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep