You are viewing a single comment's thread. Return to all comments →
def plusMinus(arr): positives, negatives, zeros = 0, 0, 0 total = len(arr) for i in arr: if i < 0: negatives += 1 elif i == 0: zeros += 1 else: positives += 1 print(f"{(positives/total):.6f}") print(f"{(negatives/total):.6f}") print(f"{(zeros/total):.6f}")
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 →