本帖最後由 tonyh 於 2022-1-27 10:04 編輯
- score=input("請輸入你的成績: ")
- score=float(score)
- 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("輸入錯誤~斬!")
複製代碼- score=input("請輸入你的成績: ")
- score=float(score)
- 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=input("請輸入你的成績: ")
- score=float(score)
- 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("輸入錯誤!")
複製代碼 |