11. Python Program to Print a Digital Receipt
MediumEscape sequences
Overview
In this challenge, you will use escape sequences in Python to format a digital receipt with proper alignment. This exercise will help you understand how to use \t (tab escape sequences) to create structured and readable output.
Task
Write a Python program that prints a purchase receipt in a neatly formatted manner using tab escape sequences. The receipt should include a list of purchased items, their quantities, prices, and the total cost.
Expected Output
Your program should print the following receipt exactly as shown:
Your Purchase Receipt
--------------------------
Item Quantity Price
Apple 2kg $5.00
Milk 1L $2.00
Banana 1 dozen $2.50
--------------------------
Total $9.50
Thank you for shopping with us!
Input
- No input is required.
Output
- A formatted receipt displaying item names, their quantities, prices, and the total amount.
Your Purchase Receipt
--------------------------
Item Quantity Price
Apple 2kg $5.00
Milk 1L $2.00
Banana 1 dozen $2.50
--------------------------
Total $9.50
Thank you for shopping with us!
This exercise will help you practice string formatting and improve your ability to create structured console outputs!