返回列表 發帖

if...elif...else



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

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

TOP

  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("輸入錯誤!")
  14.    
複製代碼

TOP

  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>=70and score<=80):
  8.     print("乙等!")
  9. elif(score>=60and score<=70):  
  10.     print("丙等!")
  11. elif(score>=0and score<=60):      
  12.     print("不及格!")
  13. else:
  14.     print("輸入錯誤")
複製代碼

TOP

  1. score=int(input("把你的成績喊出來!: "))
  2. print(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("輸入錯誤!")   
複製代碼

TOP

  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("輸入錯誤!")  
複製代碼

TOP

  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("輸入錯誤")
複製代碼

TOP

  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>=70and score<=80):
  8.     print("乙等!")
  9. elif(score>=60and score<=70):  
  10.     print("丙等!")
  11. elif(score>=0and score<=60):      
  12.     print("不及格!")
  13. else:
  14.     print("輸入錯誤")
複製代碼

TOP

score=float(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<60):
    print ("不及格")
else:
    print ("輸入錯誤")

TOP

  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("輸入錯誤!")
複製代碼

TOP

  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>=70and score<=80):
  8.     print("乙等!")
  9. elif(score>=60and score<=70):  
  10.     print("丙等!")
  11. elif(score>=0and score<=60):      
  12.     print("不及格!")
  13. else:
  14.     print("輸入錯誤")
複製代碼

TOP

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

TOP

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

TOP

  1. s=float(input("報上你的成績: "))
  2. if(s>=90 and s<=100):
  3.     print("優等")
  4. elif(s>=80 and s<=89):
  5.     print("甲等")
  6. elif(s>=70 and s<=79):
  7.     print("乙等")
  8. elif(s>=60 and s<=69):
  9.     print("丙等")
  10. elif(s>=0 and s<=59):
  11.     print("不及格")
  12. else:
  13.     print("亂打")
複製代碼
Ivy

TOP

  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("輸入錯誤!")
複製代碼

TOP

  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>=70and score<=80):
  8.     print("乙等!")
  9. elif(score>=60and score<=70):  
  10.     print("丙等!")
  11. elif(score>=0and score<=60):      
  12.     print("不及格!")
  13. else:
  14.     print("輸入錯誤!")
複製代碼

TOP

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

TOP

返回列表