Give an example of using `try`, `except`, and `finally`.

Question

Grade: Education Subject: Support
Give an example of using `try`, `except`, and `finally`.
Asked by:
56 Viewed 56 Answers

Answer (56)

Best Answer
(180)
```python try: result = 10 / 0 # This will cause a ZeroDivisionError except ZeroDivisionError: print("Cannot divide by zero.") finally: print("This will always execute.") ```