这个程序比较简单,就是if-elif-else的用法,直接上程序:
#嵌套完成学习成绩的分配
#学习成绩>=90,A
#89>=学习成绩>=60,B
#学习成绩<60,C
score = int(input("int the score:"))
grade = ''
if score >= 90:
grade = 'A'
elif score >= 60:
grade = 'B'
else:
grade = 'C'
print(grade)
这个程序比较简单,就是if-elif-else的用法,直接上程序:
#嵌套完成学习成绩的分配
#学习成绩>=90,A
#89>=学习成绩>=60,B
#学习成绩<60,C
score = int(input("int the score:"))
grade = ''
if score >= 90:
grade = 'A'
elif score >= 60:
grade = 'B'
else:
grade = 'C'
print(grade)