[Python] use Try/Except in python
1) Introduce try / except The try block contains code that might cause an exception. If an exception occurs in the try block, Python will jump to the except block that matches the exception. We have three except blocks to handle different exception types: The advantage of try-except is that we can gracefully handle errors…