采用并列式多分支结构

#编写程序 - 采用并列式多分支评定成绩等级.
# 输入部分
score = float(input('成绩:'))

# 处理部分
level = ''
if score > 100:
    level = '超出范围'
if score >= 90 and score <= 100:
    level = '优秀'
if score >= 80 and score < 90:
    level = '良好'
if score >= 70 and score < 80:
    level = '中等'
if score >= 60 and score < 70:
    level = '及格'
if score >= 0 and score < 60:
    level = '不及格'
if score < 0:
    level = '超出范围'
    
# 输出部分
print('等级:{}'.format(level))       
#欢迎观看,欢迎留言。

猜你喜欢

转载自blog.csdn.net/m0_62491934/article/details/121152604