-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_Project_1.py
More file actions
35 lines (29 loc) · 895 Bytes
/
Python_Project_1.py
File metadata and controls
35 lines (29 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Project 1 : Printing Receipt
# Define store information
store_name = "Coding Temple, Inc."
store_address = "283 Franklin St."
store_city = "Boston, MA"
# Define product names and prices
product_1 = "Books"
price_1 = 49.95
product_2 = "Computer"
price_2 = 579.99
product_3 = "Monitor"
price_3 = 124.89
# Calculate total price
total_price = price_1 + price_2 + price_3
# Print the receipt
print("*" * 50)
print(f"{store_name.center(50)}")
print(f"{store_address.center(50)}")
print(f"{store_city.center(50)}")
print("-" * 50)
print(f"{'Product Name':<20}{'Product Price':>20}")
print(f"{product_1:<20}${price_1:>19.2f}")
print(f"{product_2:<20}${price_2:>19.2f}")
print(f"{product_3:<20}${price_3:>19.2f}")
print("-" * 50)
print(f"{'Total':<20}${total_price:>19.2f}")
print("-" * 50)
print("Thanks for shopping with us today!".center(50))
print("*" * 50)