Write a Python function splitsum(l) that takes a nonempty list of integers and returns a list [pos,neg], where pos is the sum of squares all the positive numbers in l and neg is the sum of cubes of all the negative numbers in l
>>> splitsum([-1,2,3,-7])
[13, -344]
Answers
Answered by
0
Answer:
133
Explanation:
of integers and returns a list [pos,neg], where pos is the sum of squares all the positive numbers in l and neg is the sum of cubes of all the negative numbers in lof integers and returns a list [pos,neg], where pos is the sum of squares all the positive numbers in l and neg is the sum of cubes of all the negative numbers.
Answered by
0
The code and the output has been attached above.
Attachments:
Similar questions