- score=eval(input("請輸入你的成績: "))
- if score>=90 and score<=100:
- print("優等!")
- elif score>=80 and score<90:
- print("甲等!")
- elif score>=70 and score<80:
- print("乙等!")
- elif score>=60 and score<70:
- print("丙等!")
- elif score>=0 and score<60:
- print("不及格!")
- else:
- print("輸入錯誤!")
複製代碼- score=eval(input("請輸入你的成績: "))
- if score>100:
- print("輸入錯誤!")
- elif score>=90:
- print("優等!")
- elif score>=80:
- print("甲等!")
- elif score>=70:
- print("乙等!")
- elif score>=60:
- print("丙等!")
- elif score>=0:
- print("不及格!")
- else:
- print("輸入錯誤!")
複製代碼 |