value=input("输入一个数字")
while True:
if (value.isdigit()):
t = int(value)
print("daying", t)
break
else:
print("存在不包含的数字")
value = input("输入一个数字")
扩展
######连着输入5个数字#######
def input_value(value):
while True:
if (value.isdigit() ):
return_value= int(value)
break
else:
print("存在不包含的数字")
value = input("输入一个数字")
return return_value
for i in range(5):
value = input("输入一个数字")
t=input_value(value)
print("打印每一个结果",t)
######连着输入5个数字#######