Question: remember its ciss 202 for starters !! so keep it as simple as possible. Given a list of numbers, create a new list of numbers
Given a list of numbers, create a new list of numbers such that the first number in a new list is the sum of all numbers in the original list, the second number in the new list is the sum of all numbers from the original list but the first one, the third number in the new list is the sum of all numbers from the original list but the first two and so on. You are required to use list comprehension to create that new list. For example if the original list is [1, 2, 3, 4, 5, 6], the new list will be [21, 20, 18, 15, 11, 6] Hint. The sum function and slicing are your friends
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
