题解 | #牛牛的绩点#
牛牛的绩点
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: first_ele = input('') if first_ele == 'False': break else: second_ele = int(input()) list1.append(dict1[first_ele]*second_ele) list2.append(second_ele) print('%.2f'%(sum(list1)/sum(list2)))