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

mac2022-06-30  81

利用条件运算符的嵌套来完成此题

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))

转载于:https://www.cnblogs.com/fanren224/p/8457268.html

最新回复(0)