题解 | #求平均年龄#
求平均年龄
https://www.nowcoder.com/practice/ca319fdb02714994850cc631d76f5547
def avg(a): print('%.2f'%(sum(a)/len(a))) while True: try: age = [] n = int(input()) for i in range(n): a = int(input()) age.append(a) avg(age) except: break
求平均年龄
https://www.nowcoder.com/practice/ca319fdb02714994850cc631d76f5547
def avg(a): print('%.2f'%(sum(a)/len(a))) while True: try: age = [] n = int(input()) for i in range(n): a = int(input()) age.append(a) avg(age) except: break
相关推荐