Python入门(八)分支与循环
分支 先例 写一个程序,按百分制评等级:[90,100]等级为A,[80,90)等级为B,[60,80)等级为C,[0,60)等级为D,当用户输入分数时,自动转换为ABCD的形式输出。 rank1.py >>> score = int ( input ('Please Input the Score:')) if score < 0 or score > 100: print ('Input Error!') if 90 <= score <= 100: print ('A') if 80 < score <90: print ('B') if 60 < score <=80: print ('C') if 0 <= score <=60: print ('D') F5运行后,输入分数: rank2.py >>> score = int ( input ('Please Input the Score:')) if score < 0 or score > 100: print ...