Q05 Python Question - 1% of final grade - Due July 10, 2022 Write a Python function that takes a list of numbers and ret
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q05 Python Question - 1% of final grade - Due July 10, 2022 Write a Python function that takes a list of numbers and ret
Question - 1% of final grade - Due July 10, 2022 Write a Python function that takes a list of numbers and returns a list of cumulative sums of the negative numbers in the input list. Each number in the new list will be the sum of all the previous negative numbers plus the current number so long as the current number is negative; otherwise the number will be the sum of all the previous negative numbers. The input list [1, -2, 3, -4, 6] will return [0, -2, -2, -6, -6], for instance. def getCumulativeSum2 (inputList):
Q05 Python