try完整语法示例
2023-12-13 本文已影响0人
Quick_5413
try:
x=100/0
except Exception as e:
print('error:', e)
else:
print('x =', x)
finally:
print('over!')
try:
x=100/0
except Exception as e:
print('error:', e)
else:
print('x =', x)
finally:
print('over!')