您的位置:首页 > 其它

【程序15】成绩>=90分用A表示,60-89分用B表示, 60分以下用C表示。

2017-03-23 15:41 363 查看
利用条件运算符的嵌套来完成此题

score = int(input('input score:'))
if score >= 90:
grade = 'A'
elif score >= 60:
grade = 'B'
else:
grade = 'C'

print('%d belongs to %s' % (score,grade))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐