You are viewing a single comment's thread. Return to all comments →
Three line solution in Python 3:
n = int(input().strip()) arr = [int(arr_temp) for arr_temp in input().strip().split(' ')] print((len([x for x in arr if x > 0])/n), (len([x for x in arr if x < 0])/n), (len([x for x in arr if x == 0])/n), sep='\n')
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 →
Three line solution in Python 3: