Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming in Python I have this so far: lst = input().split( ) def num(x): return int(x) >= 0 b = list(filter(num,lst)) print(sum(b)) How should I

Programming in Python

image text in transcribed

I have this so far:

lst = input().split(" ") def num(x): return int(x) >= 0 b = list(filter(num,lst)) print(sum(b))

How should I correct it and what am I doing wrong?

2.5 Mapping and Filtering 3 out of 6 steps passed 1 out of 4 points received Filtering Positives The input to your program will be a single line of integers separated by single spaces. Your program should print the sum of just the positive numbers. Hint: use the ideas from the last challenge, but with filter! Sample Input 1: 8 11 -1 -3 Sample Output 1: 19

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago