Untitled

mail@pastecode.io avatar
unknown
python
2 months ago
365 B
5
Indexable
Never
print((d:=[(a:=[int(i) for i in input().split()]) and next([a[0],y] for x,y in [(90,4.3),(85,4),(80,3.7),(77,3.3),(73,3),(70,2.7),(67,2.3),(63,2),(60,1.7),(57,1.3),(53,1),(50,.7),(0,0)] if a[1]>=x) for _ in range(int(input("輸入學科數量\n")[:print("輸入完後換行:學分數 分數")]))]) and f"GPA: {sum(i[0]*i[1] for i in d)/sum(i[0] for i in d):.2f}")
Leave a Comment