题解 | #牛牛的绩点#
牛牛的绩点
https://www.nowcoder.com/practice/de8bc3e736164786b07a4dd64ed172f7
dict_check = {'A':4.0,'B':3.0,
'C':2.0,'D':1.0,'F':0}
res = 0.0
all_values = 0.0
while True:
x = input()
if x == 'False':
break
y = int(input())
res +=dict_check[x]*y
all_values += y
res = round(res/all_values,2)
print('%.2f'%res)
'C':2.0,'D':1.0,'F':0}
res = 0.0
all_values = 0.0
while True:
x = input()
if x == 'False':
break
y = int(input())
res +=dict_check[x]*y
all_values += y
res = round(res/all_values,2)
print('%.2f'%res)