笔记整理自B站UPWLB工作生活两不误的个人空间-WLB工作生活两不误个人主页-哔哩哔哩视频教程Python 程序设计题27_哔哩哔哩_bilibili
程序设计题27
Python代码
import math
ls = list(map(float, input().split()))
avg = sum(ls) / len(ls)
s = 0
for i in ls:
s += (i - avg) ** 2
res = math.sqrt(s / len(ls))
print(f'{res:.3f}')
输入样例
0 0 2 2
输出样例
1.000