-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path25206.py
More file actions
executable file
·36 lines (34 loc) · 1004 Bytes
/
25206.py
File metadata and controls
executable file
·36 lines (34 loc) · 1004 Bytes
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
result = 0.0
grade_all = 0.0
for i in range(0, 20):
subject, grade, rating = input().split()
if rating == "A+":
result += 4.5 * float(grade)
grade_all += float(grade)
if rating == "A0":
result += 4.0 * float(grade)
grade_all += float(grade)
if rating == "B+":
result += 3.5 * float(grade)
grade_all += float(grade)
if rating == "B0":
result += 3.0 * float(grade)
grade_all += float(grade)
if rating == "C+":
result += 2.5 * float(grade)
grade_all += float(grade)
if rating == "C0":
result += 2.0 * float(grade)
grade_all += float(grade)
if rating == "D+":
result += 1.5 * float(grade)
grade_all += float(grade)
if rating == "D0":
result += 1.0 * float(grade)
grade_all += float(grade)
if rating == "F":
result += 0.0 * float(grade)
grade_all += float(grade)
if rating == "P":
pass
print(result / grade_all)