-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-receipt_printing.py
More file actions
50 lines (37 loc) · 1.08 KB
/
2-receipt_printing.py
File metadata and controls
50 lines (37 loc) · 1.08 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#product and prices
p1_name , p1_price = "books",49.95
p2_name , p2_price = "Computer",579.99
p3_name , p3_price = "Monitor",124.89
#company and information
company_name = "coding temple, inc."
company_address = "283 Franklin st."
company_city = "boston , ma"
#ending message as you like to say
message = "Thanks for shopping with us today!"
#borders
print("*" * 50)
#print company information
print("\t\t{}".format(company_name.title()))
print("\t\t{}".format(company_address))
print("\t\t{}".format(company_city))
#between sections
print("=" * 50)
#print product info
print("\tProduct Name\tProdict Price")
#statement of each product
print("\t{}\t\t${}".format(p1_name.title() , p1_price))
print("\t{}\t\t${}".format(p2_name.title() , p2_price))
print("\t{}\t\t${}".format(p3_name.title() , p3_price))
#lines between sections
print('='*50)
#print out total header
print("\t\t\tTotal")
#price calculation
total = p1_price + p2_price + p3_price
print("\t\t\t${}".format(total))
#between section
print("="*50)
#ending message
print("\n\t{}\n".format(message))
#bottom border
print("*"*50)