题解 | #累加数与平均值#
累加数与平均值
https://www.nowcoder.com/practice/ed009465ad6940609542ef5879a0d697
定义接收年龄与总计的两个变量
age = input().split(" ") n = 0
利用for循环来进行年龄的累加
for i in age: n += int(i)
打印年龄的总和与年龄的平均数并保留一位小数
print(n, round(n/len(age), 1))
累加数与平均值
https://www.nowcoder.com/practice/ed009465ad6940609542ef5879a0d697
age = input().split(" ") n = 0
for i in age: n += int(i)
print(n, round(n/len(age), 1))
相关推荐