Question: write python code for Read N integers and find the sum of all positive numbers. Write a function def solution(N): that accepts an integer N.
write python code for
Read N integers and find the sum of all positive numbers.
Write a function def solution(N):
that accepts an integer N. The function should read N integers and return the sum of all positive numbers.
Input 4 2 3 -5 4
where,
- First line represents a value of N.
- Second and next lines contain N integers.
Output 9
Assume that,
- The value of N within the range from [-10000 to 10000].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
