p112
try:
x = 1
y = '0'
result = x/y
print (result)
# ZeroDivisionError if y=0
# TypeError if y='0'
except:
print("data error")
# try and except tell you have bug but not force program bug
INFO
try:
x = 1
y = '0'
result = x/y
print (result)
# ZeroDivisionError if y=0
# TypeError if y='0'
except:
print("data error")
# try and except tell you have bug but not force program bug