The sum of positive numbers and the amount negative numbers
The given parameter is a List. The function will calculate the following data:
- the sum of positive numbers
- the amount of negative number
Sample Code:
def posNeg(l):
# Enter your logic here...
Examples:
Input: [1,2,3,-4,-5,-6]
Output: [6,3]
Explanation: 6 is the sum of positive numbers, while 3 is the count of negative numbers.
Input: [-1,2,-3,4,-5,6]
Output: [12,3]
Explanation: 12 is the sum of positive numbers, while 3 is the count of negative numbers.