收起
改写成这样即可:
def getInput(): while True: try: n=input('input:') if type(eval(n))==int: return n except: pass print(getInput())
报告相同问题?