• + 0 comments

    Python I could not run the above code. Below is the final code. Just check once.

    def plusMinus(arr): # Complete this function pos=0 neg=0 zero=0 for i in arr: if i>0: pos+=1

        elif i<0:
            neg+=1
    
        else:
            zero+=1
    
    result=float(pos)/float(len(arr))
    num=float(neg)/float(len(arr))
    count=float(zero)/float(len(arr))
    
    print("%.6f" % result)
    print("%.6f" % num)
    print("%.6f" % count)