The mean final distance of an -step lattice walk grows a little slower than , but the mean of the squared distances is exactly , so the root-mean-square distance (the square root of the mean of the squared distances) tracks . Write the function rmsDistance(distances) that returns the root-mean-square of a non-empty list of distances, as a float.
print(round(rmsDistance([3, 4]), 4)) # 3.5355 print(rmsDistance([0, 0, 0, 2])) # 1.0