You are viewing a single comment's thread. Return to all comments →
def plusMinus(arr): positive = len([i for i in arr if i > 0]) negative = len([i for i in arr if i < 0]) zero = len([i for i in arr if i == 0]) print(f"{positive/len(arr):.6f}") print(f"{negative/len(arr):.6f}") print(f"{zero/len(arr):.6f}") n = int(input()) arr = list(map(int, input().split())) plusMinus(arr)
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 →
For Python3 Platform
I wrote the code from scratch just to get more practice