We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defplusMinus(arr):# Write your code herenegCount=0;posCount=0;zerCount=0;foriinarr:ifi<0:negCount+=1elifi>0:posCount+=1else:zerCount+=1print(posCount/len(arr))print(negCount/len(arr))print(zerCount/len(arr))if__name__=='__main__':n=int(input().strip())arr=list(map(int,input().rstrip().split()))plusMinus(arr)
Cookie support is required to access HackerRank
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 →