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.
I felt like cheating too so opened the discussion forum for the first time to see this post :D
n=float(raw_input())
numbers=map(int,raw_input().split())
print round(len([x for x in numbers if x>0])/n,3)
print round(len([x for x in numbers if x<0])/n,3)
print round(len([x for x in numbers if x==0])/n,3)
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 →
I felt like cheating too so opened the discussion forum for the first time to see this post :D