Plus Minus

  • + 0 comments

    n=int(input('')) arr = list(map(int, input().split())) def plusMinus(arr): '''counts the number of positive and negative integers as well as zeros ''' pos= 0 neg= 0 zero= 0 for i in arr: if i > 0: pos += 1 elif i < 0: neg +=1 else: zero += 1 return pos, neg, zero arr_count = (plusMinus(arr)) for num in arr_count: print(num/n)