|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
这是代码1
while True:
temp = input('请输入一个整数')
while not temp.isdigit():
temp = input("输入错误,请重新输入。")
secret = int(temp)
while secret > 100 or secret < 0:
temp = input("请输入0到100之前的数字。")
secret = int(temp)
if secret>80 and secret <= 100:
print("A")
elif secret<=80 and secret>60:
print("B")
elif secret>40 and secret<=60:
print("C")
else:
print("D")
这是代码二
while True:
temp = input('请输入一个整数')
while not temp.isdigit(): # 更改
temp = input("输入错误,请重新输入。")
secret = int(temp)
while secret > 100 or secret < 0:
temp = input("请输入0到100之前的数字。") # 更改
secret = int(temp) # 更改
if secret > 80 and secret <= 100:
print("A")
elif secret <= 80 and secret > 60:
print("B")
elif secret > 40 and secret <= 60:
print("C")
else:
print("D")
天啊,这明明一样啊,,,为什么我的运行不了,,代码一是我的,代码二是某版主更改过的,,,为什么代码二可以运行,代码一却错误??
这两个代码哪里错误了吗?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????一脸懵逼
|
|