2
想要右边的一直查询,按下e结束我这个一直是B
x=int(input('please a num:'))
while x!='e':
if 0<=x<=100:
if x==100:
print('S')
else:
if x>=90:
print('A')
else:
if x>=80:
print('B')
else:
if x>=60:
print('C')
else:
print('D')
else:
print('input error')
"""score = input("请输入你的分数:")
score = int(score)
if score < 60:
print("D")
if 60 <= score < 80:
print("C")
if 80 <= score < 90:
print("B")
if 90 <= score < 100:
print("A")
if score == 100:
print("S")"""
循环里加入input
x=input('please a num:')
while x!='e':
x=int(x)
if 0<=x<=100:
if x==100:
print('S')
else:
if x>=90:
print('A')
else:
if x>=80:
print('B')
else:
if x>=60:
print('C')
else:
print('D')
x = input('please a num:')
else:
print('input error')
x = input('please a num:')
else:
print('退出') 楼上说的对。不过可以再美观一点。
x = input('please a num:')
while x != 'e':
x = int(x)
if x < 0 or x > 100:
print('input error')
elif x == 100:
print('S')
elif x >= 90:
print('A')
elif x >= 80:
print('B')
elif x >= 60:
print('C')
else:
print('D')
x = input('please a num:') 疾风怪盗 发表于 2020-9-20 12:42
循环里加入input
nb
页:
[1]