In this example we will show how to define a block of code to be executed if no errors were raised using the else keyword in Python.
Source Code
try:
x = int(10.25)
except:
print('An exception occurred!')
else:
print('No errors occurred!')
Output:
No errors occurred!