-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActivity2.py
39 lines (35 loc) · 893 Bytes
/
Activity2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name = str(input('Name: '))
while True:
try:
math_grade = float(input('Math Grade: '))
break
except ValueError:
print('Invalid Input')
continue
while True:
try:
science_grade = float(input('Science Grade: '))
break
except ValueError:
print('Invalid Input')
continue
while True:
try:
english_grade = int(input('English Grade: '))
break
except ValueError:
print('Invalid Input')
continue
ave = (math_grade + science_grade + english_grade) / 3
if ave >= 75:
status = 'PASSED'
elif ave < 75:
status = 'FAILED'
else:
status = 'Invalid'
print('Name:', name)
print('Math Grade:', math_grade)
print('Science Grade:', science_grade)
print('English Grade:', english_grade)
print('Average: %0.2f' % ave)
print('Status:', status)