0 votes
1 view
in Data Science by (7.1k points)

Can someone please explain why hackerrank does not accept this code for python?

def plusMinus(arr):

    positive = "{0:.6f}".format(sum(1 for i in arr if i > 0) / len(arr))

    negative = "{0:.6f}".format(sum(1 for i in arr if i < 0) / len(arr))

    zero = "{0:.6f}".format(sum(1 for i in arr if i == 0) / len(arr))

    return "\n".join([positive, negative, zero])

It gives me the error: 

~ no response on stdout ~

Please log in or register to answer this question.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...