• + 0 comments

    def plusMinus(arr): n = len(arr) positive = neg = zero = 0

    for num in arr:
        if num > 0:
            positive += 1
        elif num < 0:
            neg += 1
        else:
            zero += 1
    
    # Print ratios with 6 decimal places
    print("{0:.6f}".format(positive / n))
    print("{0:.6f}".format(neg / n))
    print("{0:.6f}".format(zero / n))