Market Receipt
Python
15 pts
Market Receipt
Abel buys some items at a market in Asmara. Write a program that works out his bill.
- Create
total: the sum ofbread,milkandcoffee. - If
totalis more than100, Abel gets 10% off: creatediscountequal to 10% oftotal. Otherwisediscountis0. - Create
to_pay=totalminusdiscount. - Print exactly:
Total: 120 Nakfa Discount: 12.0 Nakfa To pay: 108.0 Nakfa
Checklist
- Create
total. - Work out
discountwith a condition. - Create
to_pay. - Print the three lines exactly.
🔑 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.
