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.
Here are some examples to show how your function should work.
>>> splitsum([1,3,-5])
[10, -125]
>>> splitsum([2,4,6])
[56, 0]
>>> splitsum([-19,-7,-6,0])
[0, -7418]
>>> splitsum([-1,2,3,-7])
[13, -344]
Answers
Answered by
2
Answer:
so long question sorry
Explanation:
please mark me as a brainliest
Answered by
0
The code and the output has been attached above, kindly check it.
Attachments:
Similar questions