Total Sales
Python
15 pts
Total Sales
A shop recorded five sales (in Nakfa). Use a for loop to:
- Print each sale as
Sale: 120and so on. - Add each sale to
total.
After the loop, print the total. Expected output:
Sale: 120 Sale: 95 Sale: 150 Sale: 80 Sale: 200 Total: 645
Checklist
- Keep the list
salesunchanged. - In a
forloop, print each sale and add it tototal. - After the loop, print the total as
Total: 645.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
