parent
00a3941355
commit
35fb665eb0
|
@ -118,7 +118,9 @@ Author: 骆昊
|
|||
"""
|
||||
|
||||
score = float(input('请输入成绩: '))
|
||||
if score >= 90:
|
||||
if score >100 or score < 0:
|
||||
grade = 'F'
|
||||
elif score >= 90:
|
||||
grade = 'A'
|
||||
elif score >= 80:
|
||||
grade = 'B'
|
||||
|
@ -128,6 +130,10 @@ elif score >= 60:
|
|||
grade = 'D'
|
||||
else:
|
||||
grade = 'E'
|
||||
|
||||
if grade == 'F':
|
||||
print('请检查输入成绩有效性!')
|
||||
else:
|
||||
print('对应的等级是:', grade)
|
||||
```
|
||||
#### 练习3:输入三条边长,如果能构成三角形就计算周长和面积。
|
||||
|
|
Loading…
Reference in New Issue