Answered step by step
Verified Expert Solution
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
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: 19Step 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