本帖最後由 tonyh 於 2022-3-26 16:19 編輯
- score=float(input("請輸入你的成績: "))
- if score>100 or score<0:
- print("輸入錯誤")
- elif score>=90:
- print("優")
- elif score>=80:
- print("甲")
- elif score>=70:
- print("乙")
- elif score>=60:
- print("丙")
- else:
- print("不及格")
複製代碼- score=float(input("請輸入你的成績: "))
- if 90<=score<=100:
- print("優")
- elif 80<=score<90:
- print("甲")
- elif 70<=score<80:
- print("乙")
- elif 60<=score<70:
- print("丙")
- elif 0<=score<60:
- print("不及格")
- else:
- print("輸入錯誤")
複製代碼- score=float(input("請輸入你的成績: "))
- if score>=90<=100:
- print("優")
- elif score>=80<90:
- print("甲")
- elif score>=70<80:
- print("乙")
- elif score>=60<70:
- print("丙")
- elif score>=0<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("輸入錯誤!")
複製代碼 |