14 lines
347 B
Python
14 lines
347 B
Python
def format_receipt(price, qty):
|
|
"""Return a 3-line formatted receipt as a single string.
|
|
|
|
Format (note the dollar sign and 2-decimal places on prices):
|
|
|
|
Item price: $<price>
|
|
Quantity: <qty>
|
|
Total: $<price * qty>
|
|
|
|
format_receipt(9.99, 3) returns:
|
|
"Item price: $9.99\nQuantity: 3\nTotal: $29.97"
|
|
"""
|
|
pass
|