Question
Give an example of using `try`, `except`, and `finally`.
Asked by: USER1718
56 Viewed
56 Answers
Answer (56)
```python
try:
result = 10 / 0 # This will cause a ZeroDivisionError
except ZeroDivisionError:
print("Cannot divide by zero.")
finally:
print("This will always execute.")
```