Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started