题解 | #牛牛的绩点#
牛牛的绩点
https://www.nowcoder.com/practice/de8bc3e736164786b07a4dd64ed172f7
#学分*绩点 sum1=0 #学分和 sum2=0 dic={'A':4.0,'B':3.0,'C':2.0,'D':1.0,'F':0} while True: try: s=input() if s=='False': print('%.2f'%(sum1/sum2)) break else: num=int(input()) sum1=sum1+num*dic[s] sum2=sum2+num except: break