You are viewing a single comment's thread. Return to all comments →
def plusMinus(arr): n=len(arr) count_p=0 count_neg=0 count_zero=0 for i in arr: if i>0: count_p+=1 elif i<0: count_neg+=1 elif i==0: count_zero+=1 print(count_p/n) print(round(count_neg/n,6)) print(round(count_zero/n,6))
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
def plusMinus(arr): n=len(arr) count_p=0 count_neg=0 count_zero=0 for i in arr: if i>0: count_p+=1 elif i<0: count_neg+=1 elif i==0: count_zero+=1 print(count_p/n) print(round(count_neg/n,6)) print(round(count_zero/n,6))