You are viewing a single comment's thread. Return to all comments →
Python solution Using list comprehension
def plusMinus(arr): print("%.6f"%(len([x for x in arr if x > 0]) / len(arr))) print("%.6f"%(len([x for x in arr if x < 0]) / len(arr))) print("%.6f"%(len([x for x in arr if x == 0]) / len(arr)))
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Python solution Using list comprehension