catching user exceptions python code example
Example 1: python exception
try:
# code block
except ValueError as ve:
print(ve)
Example 2: try except python
try: #try to do the following
print("Hi there")
except: #If what is meant to happen in (try) fails, do this.
print("A error happened with the code above")