python try catch else code example
Example 1: exception pyton print
except Exception as e: print(e)
Example 2: python try else
try:
a=2*3
except TypeError:
print("Exception raised")
else:
print("Everything is ok.")
except Exception as e: print(e)
try:
a=2*3
except TypeError:
print("Exception raised")
else:
print("Everything is ok.")