python多重条件if判断输入分数是否及格
#!/usr/bin/python3
score = int(input('分数: ')) #交互式输入分数,并使用int()转换成数值,赋值给变量score
if score >= 90:
print('优秀')
elif score >= 80:
print('良')
elif score >= 70:
print('中')
elif score >= 60:
print('及格')
else:
print('需要努力')
#!/usr/bin/python3
score = int(input('分数: '))
if 60 <= score <70:
print('及格')
elif 70 <= score < 80:
print('良')
elif 80 <= score < 90:
print('好')
elif 90 <= score <=100:
print('优秀')
else:
print('你需要努力了!!!')