Back to Lesson
Absolute Summation
Chain multiple built-in functions seamlessly.
Instructions
- Given a list of financial variations:
deltas = [-4.5, 2.1, -8.9, 1.2, -0.4] - You want the total absolute change.
- Use a generator expression (or a loop) to take theof every number, then
abs()the results, and finallysum()to 1 decimal place. Print the final result.round()
main.py
main.py
Ctrl + Enter