Write a function called manipulate_data which will act as follows:
When given a list of integers, return a list, where the first element is the count of positives numbers and the second element is the sum of negative numbers.
NB: Treat 0 as positive.
1
Expert's answer
2016-09-16T09:17:03-0400
def manipulate_data(values): a = len(filter(lambda x : x >= 0, values)) b = sum(filter(lambda x : x < 0 , values)) return [a, b]
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment