Question: 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

Programming in Python I have this so far: lst = input().split(" ")

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!