Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

ISBN: 1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

11. Are your speaking notes helpful and effective?

Answered: 1 week ago

Question

The Goals of Informative Speaking Topics for Informative

Answered: 1 week ago