Python Developer — Medium
Key points
- The ZeroDivisionError is caught by the except block
- The value of x is set to -1 in the except block
- The finally block always executes, printing the value of x
- The code handles the ZeroDivisionError gracefully
Ready to go further?
Related questions
