提示錯誤為: TypeError: '>=' not supported between instances of 'str' and 'int'
因為 input 接收到的都是字符串類型,解決方案是轉變字符類型。
score=int(input ("請輸入你的成績:"))
if score >= 90:
print('優秀')
elif score < 90 and score>=80:
print('良好')
elif score < 80 and score>=60:
print('及格')
else:
print('不及格')