The words “try” and “except” are Python keywords and are used to catch exceptions. For example:
try:
print 1/0
except ZeroDivisionError:
print ‘Error! We cannot divide by zero!!!’
详情回复
发表于 2021-7-8 09:48
The words “try” and “except” are Python keywords and are used to catch exceptions. For example:
try:
print 1/0
except ZeroDivisionError:
print ‘Error! We cannot divide by zero!!!’