本帖最后由 青出于蓝 于 2021-7-16 13:20 编辑
- while True:
- print('.....................................................')
- h=input('enter your point >> ')
- i=1
- d=1
- while d!=2:
- while i!= 2:
- if not h.isdigit():
- print('your key words is not number')
- h=input('enter your point >> ')
- else :
- i=i+1
- y=int(h)
- while i!= 3:
- if y>100 or y<1:
- print(' the number is entered by your entering must be between 1 and 100')
- h=input('enter your point >> ')
- else :
- i=i+1
- y=int(h)
- if y >= 60 and y < 80:
- print (h+' got C')
- d=d+1
- elif y < 60:
- print (h+' got D')
- d=d+1
- else :
- print (h+' got A')
- d=d+1
复制代码
1,这个d!=100不需要,可以在外面套一个大循环实现
2,源代码有一点错误,判断时输入61为C,但输入60为A。判断代码写错了,已经改了