• [deleted]
    + 0 comments
    def stdDev(arr):
        # Print your answers to 1 decimal place within this function
        s = sum(arr)
        l = len(arr)
        mean = s/l
        
        a=[]
        
        for i in range(l):
            ans = abs(arr[i]-mean)
            new_ans = ans*ans
            a.append(new_ans)
        
        new_sum = sum(a)
        standard = new_sum / l
        answer = math.sqrt(standard)
        print(f"{answer:.1f}")