Board logo

標題: if...elif...else [打印本頁]

作者: tonyh    時間: 2020-7-28 09:13     標題: if...elif...else



本帖隱藏的內容需要回復才可以瀏覽

作者: 王法棣    時間: 2020-7-28 09:43

  1. score=float(input('請輸入你的成績: '))
  2. if(score<=100 and score>=90):
  3.     print('優等!')
  4. elif(score<90 and score>=80):
  5.     print('甲等!')
  6. elif(score<80 and score>=70):
  7.     print('乙等!')
  8. elif(score<70 and score>=60):
  9.     print('丙等!')
  10. elif(score<60 and score>=0):
  11.     print('不及格!')
  12. else:
  13.     print('輸入錯誤!')
複製代碼

作者: 陳紀希    時間: 2020-7-28 09:45

  1. score=input("請輸入你的成績: ")
  2. score=float(score)
  3. if(score>=90 and score<=100):
  4.     print("優等")
  5. elif(score>=80 and score<90):
  6.     print("甲等")
  7. elif(score>=70 and score<80):
  8.     print("乙等")   
  9. elif(score>=60 and score<70):
  10.     print("丙等")
  11. elif(score>=0 and score<60):
  12.     print("不及格~")
  13. else:
  14.     print("輸入錯誤")
複製代碼

作者: 楊子瑩    時間: 2020-7-28 09:45

  1. score=input("請輸入你的成績: ")
  2. score=float(score)
  3. if(score>=90 and score<=100):
  4.    print("優等!")
  5. elif(score>=80 and score<90):
  6.    print("甲等!")
  7. elif(score>=70 and score<80):
  8.    print("乙等!")
  9. elif(score>=60 and score<70):
  10.    print("丙等!")
  11. elif(score>=0 and score<60):
  12.    print("不及格!")
  13. else:
  14.    print("輸入錯誤...斬!")
複製代碼

作者: 李睿騏    時間: 2020-7-28 09:47

  1. score=float(input("請輸入你的成績:"))
  2. if(score>=90 and score<=100):
  3.     print("優等")
  4. elif(score>=80 and score<90):
  5.     print("甲等")
  6. elif(score>=70 and score<80):
  7.     print("乙等")
  8. elif(score>=60 and score<70):
  9.     print("丙等")
  10. elif(score>=0 and score<60):
  11.     print("不及格")
  12. else:
  13.     print("不及格....斬")
複製代碼

作者: 林家代    時間: 2020-7-28 09:48

  1. score=int(input("請輸入你的成績: "))
  2. if(score>=90 and score<=100):
  3.     input("優等!")
  4. elif(score>=80 and score<90):
  5.     print("甲等!")
  6. elif(score>=70 and score<80):
  7.     print("乙等")
  8. elif(score>=60 and score<70):
  9.     print("丙等")
  10. elif(score>=0 and score<60):
  11.     print("不及格")
  12. else:
  13.     print("輸入錯誤")
複製代碼

作者: 陳星翰    時間: 2020-7-28 09:50

本帖最後由 陳星翰 於 2020-7-28 11:44 編輯
  1. score=float(input(("please enter your score: ")))
  2. if (score>=90 and score<=100):
  3.     print("Good job, u pass")
  4. elif (score>=80 and score<90):
  5.         print("you passed with nice")
  6. elif (score>=70 and score<80):
  7.         print("you kinda dumb, but still a pass")
  8. elif (score>=60 and score<70):
  9.         print("you passed, but this is a bad score")
  10. elif (score>=0 and score<60):
  11.         print("only raymond gets this score, get out")
  12. else :
  13.     print("you dumb? this aint no score")
複製代碼

作者: 林睿謙    時間: 2020-7-28 09:50

  1. score=input("請輸入你的成績")
  2. score=float(score)
  3. if(score>=90 and score<=100):
  4.    print("優等!")
  5. elif(score>=80 and score<90):
  6.    print("甲等")
  7. elif(score>=80 and score<90):
  8.    print("乙等")
  9. elif(score>=80 and score<90):
  10.    print("丙等")
  11. elas(score>=80 and score<90):
  12.    print("乙等")
複製代碼

作者: 戴睿呈    時間: 2020-7-28 09:51

回復 1# tonyh
  1. score=input("enter your score: ")
  2. score=float(score)
  3. if(score>=90 and score<=100):
  4.     print("Congrats you passed!")
  5. elif(score>=80 and score<90):
  6.     print("u pass with nice")
  7. elif(score>=70 and score<80):
  8.     print("you kinda dumb but you still passed")
  9. elif(score>=0 and score<70):
  10.     print("you dumb jus like hudson he is dumb dumb -5 iq")
  11. else:
  12.     print("that aint no score you hudson?!")
複製代碼

作者: 林婕瀅    時間: 2020-7-28 09:51

  1. score:float(input("請輸入你的成績"))
  2. if(score>=90 and score<=100):
  3. print("優等")
  4. elfe(score>=80 and score<90)
  5. print("甲等")
  6. elfe(score>=70 and score<80)
  7. print("乙等")
  8. elfe(score>=60 and score<70)
  9. print("丙等")
  10. elfe(score>100 and score<0)
  11. print("輸入錯誤")
  12. else
  13. print("不及格")
複製代碼

作者: 蔡鈞峰    時間: 2020-7-28 09:51

  1. a=int(input("請輸入成績:"))
  2. if a>=90 and a<=100:
  3.     print("優等")
  4. elif a>=80 and a<90:   
  5.     print("甲等")
  6. elif a>=70 and a<80:   
  7.     print("乙等")
  8. elif a>=60 and a<70:   
  9.     print("丙等")
  10. elif a>=0 and a<60:
  11.     print("不及格")
  12. else:
  13.     print("輸入錯誤...斬!")
複製代碼

作者: 楊書華    時間: 2020-7-28 09:53

  1. score=float(input("Please Enter Your Score: "))
  2. if(score>100 or score<0):
  3.     print("Invalid Entry! Please Try Again!")
  4. elif(score<=100 and score>96):
  5.     print("A+! Well Done!")
  6. elif(score<=96 and score>=93):
  7.     print("A.. You could do better next time!")
  8. elif(score<=93 and score>=90):
  9.     print("You have an A-.You are no longer a qualified Asian!")
  10. elif(score<90 and score>86):
  11.     print("B+")
  12. elif(score<=86 and score>82):
  13.     print("B")
  14. elif(score<=82 and score>=80):
  15.     print("B-")
  16. elif(score<80 and score>=77):
  17.     print("C+! How dare you? This Score should not have existed in my class!")
  18. elif(score<77 and score>=73):
  19.     print("C! Did you even try?")
  20. elif(score<73 and score>=70):
  21.     print("C-")
  22. elif(score<70 and score>=67):  
  23.     print("D+! You are such a faliure!")
  24. elif(score<67 and score>=63):
  25.     print("D")
  26. elif(score<63 and score>=60):
  27.     print("D-...I have no hope in you! You are not going to be successful in the future! You can't even read!")
  28. else:
  29.     print("F!!!Get Out of my Room NOW! Get OUT! You Idiot!")
複製代碼

作者: 黃明晧    時間: 2020-7-28 09:55

score=float(input("Enter Your Score"))
if(score<=90 and score>=100):
    print("S-Tier")
elif(score<=80 and score>=90):
    print("A-Tier")
elif(score<=70 and score>=80):
    print("B-Tier")
elif(score<=60 and score>=70):
    print("D-Tier")
elif(score<=50 and score>=60):
    print("E-Tier")
elif(score<=0 and score>=50):
    print("F-Tier")
作者: 黃家穎    時間: 2020-7-28 09:56

  1. score:float(input("請輸入你的成績: "))
  2. if(score>=90 and score<=100):
  3.     print("優等!")
  4. elif(score>=80 and score<90):
  5.     print("甲等!")
  6. elif(score>=70 and score<80):
  7.     print("乙等!")
  8. elif(score>=60 and score<70):
  9.     print("丙等!")
  10. elif(score>100 and <0)
  11.     print("輸入錯誤!")
  12. elif(不及格)
  13. print(不及格...斬!)
複製代碼

作者: 蔡旭隆    時間: 2020-7-28 09:57

  1. score=int(input("請輸入成績"))
  2. if score>90 and score<=100:
  3.    print("優等")
  4. elif score>80 and score<90:
  5.    print("甲等")  
  6. elif score>70 and score<80:
  7.    print("乙等")
  8. elif score>60 and score<70:
  9.    print("丙等")
  10. elif score>0 and score<60:
  11.    print("不及格")
  12. else:
  13.    print("輸入錯誤")
複製代碼

作者: 黃明曄    時間: 2020-7-28 09:58

  1. score=input("Enter Your Score")
  2. score=float(score)
  3. if(score>=90 and score <=100):
  4.     print("A-tier")
  5. elif(score>=80 and score <=90):
  6.     print("B-tier")
  7. elif(score>=70 and score <=80):
  8.     print("c-teir")
  9. elif(score>=60 and score <=70):
  10.     print("D-tier")
  11. elif(score>=0 and score <60):
  12.     print("ur bad")
  13. else:
  14.     print("pls type like a normal human being ")   
複製代碼

作者: 黃瀚永    時間: 2020-7-28 10:02

  1. score=input("請輸入你的成績: ")   
  2. score=float(score)
  3. if(score>=90 and score<=100):
  4.     print("優等!")
  5. elif(score>=80 and score<90):   
  6.     print("甲等!")
  7. elif(score>=70 and score<80):   
  8.     print("乙等!")
  9. elif(score>=60 and score<70):   
  10.     print("丙等!")
  11. elif(score>=0 and score<60):   
  12.     print("不及格!")
  13. else:   
  14.     print("輸入錯誤!")
複製代碼





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/) Powered by Discuz! 7.2