The Pearson correlation coefficient measures how linearly related two variables are, from to :
Implement pearson(x, y) without using np.corrcoef or any library correlation function. If either input has zero variance, return 0.0.
Example
pearson([1, 2, 3, 4], [2, 4, 6, 8]) # 1.0