Receipt Builder
Python
25 pts
Receipt Builder
Prices arrived as text: coffee = "15.5" and cake = "22".
- Create
totalas a float (the sum of both prices). - Create
whole— the total as anint(decimals cut off). - Create
receipt="Total: 37.5 Nakfa"built with+andstr(). - Print
receipt, thenwhole.
Expected output:
Total: 37.5 Nakfa 37
Checklist
- Keep
coffeeandcakeunchanged. - Create
total, the sum of both prices as a float. - Create
whole, the total as anint. - Create
receipt="Total: 37.5 Nakfa"using+andstr(). - Print
receipt, thenwhole.
🔑 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.
