Skip to content

Commit

Permalink
if elis else
Browse files Browse the repository at this point in the history
  • Loading branch information
snow feng committed Dec 31, 2023
1 parent 32fed29 commit ba32c3d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CartonPython/lesson5/ch5_1_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# coding=utf-8
# Filename: ch5_1_3.py

score = int(input("请输入一个0~100的整数:"))
grade = "N"

if score > 100:
print("输入不正确,哪有这么多分啊!")
elif score == 100:
grade = "A+"
elif score >= 90:
grade = "A"
elif score >= 80:
grade = "B"
elif score >= 70:
grade = "C"
elif score >= 60:
grade = "D"
elif score >= 0:
grade = "F"
else:
print ("输入错误,没有负分!")

print("Grade = " + grade)

0 comments on commit ba32c3d

Please sign in to comment.