Price List with a Total
Python
15 pts
Price List with a Total
Use a for loop over the tuple prices to:
- print each price followed by
Nakfa, and - add each price to a variable
total(start it at0).
After the loop, print the total.
Expected output:
12 Nakfa 25 Nakfa 40 Nakfa Total: 77
Checklist
- Keep
pricesunchanged. Starttotalat0and add each price to it inside aforloop. - Print each price followed by
Nakfa, and after the loop print the total.
🔑 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.
