You are viewing a single comment's thread. Return to all comments →
Python 3
def plusMinus(arr): n = 0 p = 0 z = 0 l = len(arr) for x in arr: if x == 0: z+=1 elif x > 0: p+=1 else: n+=1 [print(round(x,6)) for x in [float(p/l),float(n/l),float(z/l)]]
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 →
Python 3