#!/usr/bin/env python
#coding:UTF-8
import random
number = random.randint(1,101)
guess=0
while True:
num_input =input("please input one integer that is 1 to 100:")
guess += 1
if not num_input.isdight():
print("please input interger")
elif int(num_input) < 0 or int(num_input) >= 100:
print("the number should be in 1 to 100")
else:
if number==int(num_input):
print("you are right")
break
elif number > int(num_input):
print("your number is more less")
elif number < int(num_input):
print("your number is more bigger")
else:
print("I will not work")
我运行随便输入范围内的数字 结果报错说if not num_input.isdight():
AttributeError: 'str' object has no attribute 'isdight' 怎么回事 谢谢了
慕丝7291255
相关分类