Python 官方文档:入门教程 => 点击学习
输入一个测验成绩评定A-FA:90-100B:80-89C:70-79D:60-69F:<60#!/usr/bin/env python score = int(raw_input('Please enter a score:'))
输入一个测验成绩评定A-F
A:90-100
B:80-89
C:70-79
D:60-69
F:<60
#!/usr/bin/env python
score = int(raw_input('Please enter a score:'))
def print_score(g):
print "your score is %s " % g
if 90 < score <= 100:
print_score('A')
elif score > 80:
print_score('B')
elif score > 70:
print_score('C')
elif score > 60:
print_score('D')
else:
print_score('F')
--结束END--
本文标题: python判断成绩给等级
本文链接: https://www.lsjlt.com/news/188578.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0