print ("+++++++++++++++++++++++")
print (" คำนวณเกรด")
print ("+++++++++++++++++++++++")
score = int(input("ป้อนคะแนน : "))
print ("+++++++++++++++++++++++")
if (score >= 80) :
print ("เกรด 4")
elif ((score >= 75) and (score <= 79)) :
print ("เกรด 3.5")
elif ((score >= 70) and (score <= 74)) :
print ("เกรด 3")
elif ((score >= 65) and (score <= 69)) :
print ("เกรด 2.5")
elif ((score >= 60) and (score <= 64)) :
print ("เกรด 2.")
elif ((score >= 55) and (score <= 59)) :
print ("เกรด 1.5")
elif ((score >= 50) and (score <= 54)) :
print ("เกรด 1")
elif ((score >= 0) and (score <= 50)) :
print ("เกรด 0")
print ("+++++++++++++++++++++++")
แจกโค้ด python 3
print (" คำนวณเกรด")
print ("+++++++++++++++++++++++")
score = int(input("ป้อนคะแนน : "))
print ("+++++++++++++++++++++++")
if (score >= 80) :
print ("เกรด 4")
elif ((score >= 75) and (score <= 79)) :
print ("เกรด 3.5")
elif ((score >= 70) and (score <= 74)) :
print ("เกรด 3")
elif ((score >= 65) and (score <= 69)) :
print ("เกรด 2.5")
elif ((score >= 60) and (score <= 64)) :
print ("เกรด 2.")
elif ((score >= 55) and (score <= 59)) :
print ("เกรด 1.5")
elif ((score >= 50) and (score <= 54)) :
print ("เกรด 1")
elif ((score >= 0) and (score <= 50)) :
print ("เกรด 0")
print ("+++++++++++++++++++++++")