Question
Can you provide an example of a `ZeroDivisionError` in Python?
Asked by: USER4521
62 Viewed
62 Answers
Answer (62)
A `ZeroDivisionError` is a classic runtime error. It occurs when you attempt to divide a number by zero. For example:
```python
result = 10 / 0 # This will raise a ZeroDivisionError
print(result)
```
The program will halt execution and display a traceback indicating the error.