异常处理——python经典实例
提问人:杨紫红发布时间:2020-11-26
#! /usr/bin/python
s=input("Input your age:")
if s =="":
raise Exception("Input must no be empty.")
try:
i=int(s)
except Exception as err:
print(err)
finally: # Clean up action
print("Goodbye!")
s=input("Input your age:")
if s =="":
raise Exception("Input must no be empty.")
try:
i=int(s)
except Exception as err:
print(err)
finally: # Clean up action
print("Goodbye!")
继续查找其他问题的答案?
相关视频回答
回复(0)
点击加载更多评论>>