how can I print the Error message with try except in python

前端 未结 0 1347
忘了有多久
忘了有多久 2021-01-06 07:56

I want to see Error message and use try ~ except at the same time.

for example,

try: print(1/0)

except: print(1+2)

if there is a zerodivisionerro

相关标签:
回答
  • 消灭零回复
提交回复
热议问题