sum of positive numbers in array with negative python

Solutions on MaxInterview for sum of positive numbers in array with negative python by the best coders in the world

showing results for - "sum of positive numbers in array with negative python"
Rebeca
23 Mar 2016
1def positive_sum(numbers):
2    positive_sum = 0
3    for n in numbers:
4        if n > 0:
5            positive_sum += n
6    return positive_sum
7positive_sum([1,-4,7,12])