To compute a sum we can use the + operator and add values together. Yet, it would be excessively difficult to do that for large lists (imagine if there are 100 values).
Python has a built-in function sum which given a list computes the sum of its elements.
Having 8 floating-point numbers in the input, your task is to print the sum of 8, then the sum of the first 7 elements, then the sum of the first 6, the sum of 5, 4, ..., up to one element.
Input
Output
1 2 3 4 5 6 7 8
36 28 21 15 10 6 3 1
Tip 1
You can use del to remove the last element after each sum calculation