计蒜客:求平均年龄Python方法

题目链接:https://nanti.jisuanke.com/t/T1050
用到print字符串小数点方法

n = int(input())
stus = []
num = 0
for i in range(0, n):
    temp = int(input())
    stus.append(temp)
    num += temp
    pass
print("%.2f"%(num / n))
posted @ 2020-05-06 21:08  Aeterna_Gungnir  阅读(1150)  评论(0编辑  收藏  举报