We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#!/bin/python3importmathimportosimportrandomimportreimportsys## Complete the 'stdDev' function below.## The function accepts INTEGER_ARRAY arr as parameter.#defstdDev(arr):# Print your answers to 1 decimal place within this functionres=0mean=sum(arr)/len(arr)foriinrange(len(arr)):res+=math.pow((arr[i]-mean),2)print(math.sqrt(res//len(arr)))if__name__=='__main__':n=int(input().strip())vals=list(map(int,input().rstrip().split()))stdDev(vals)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Standard Deviation
You are viewing a single comment's thread. Return to all comments →