题解 | #牛牛的绩点#
牛牛的绩点
https://www.nowcoder.com/practice/de8bc3e736164786b07a4dd64ed172f7
dict1 = {"A": 4.0, "B": 3.0, "C": 2.0, "D": 1.0, "F": 0}
list1 = []
list2 = []
while True:
grade = input()
if grade == "False":
break
else:
score = int(input())
list1.append(dict1[grade] * score)
list2.append(score)
print("{:.2f}".format(sum(list1) / sum(list2)))
为什么不是`(分数*学分)的总和/总学分`呢
#悬赏#