1. 作业: 输入年龄并且将年龄值转换成整数,如果输入错误程序不崩溃,让其重新输入,直到输入无误为止...
while True:
try:
age = int(input("请输入年龄(整数):"))
if type(age)==int:
break
except:
continue
while True:
try:
age = int(input("请输入年龄(整数):"))
if type(age)==int:
break
except:
continue
本文标题:day12作业 异常处理和PIL包的使用
本文链接:https://www.haomeiwen.com/subject/xfhomqtx.html
网友评论