-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtax_purchase.py
More file actions
23 lines (18 loc) · 785 Bytes
/
tax_purchase.py
File metadata and controls
23 lines (18 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
### The states of CA, MN, and NY have taxes of 7.5%, 9.5%, and 8.9% respectively.
### Take the amount of a purchase and the corresponding state to assure
### that they are taxed by the right amount.
state = "MN"
purchase_amount = 176
if state == "CA":
tax_amount = .075
total_cost = purchase_amount * (1+tax_amount)
result = "Since you're from {}, your total cost is {}.".format(state, total_cost)
elif state == "MN":
tax_amount = .095
total_cost = purchase_amount * (1+tax_amount)
result = "Since you're from {}, your total cost is {}.".format(state, total_cost)
elif state == "NY":
tax_amount = .089
total_cost = purchase_amount * (1+tax_amount)
result = "Since you're from {}, your total cost is {}.".format(state, total_cost)
print(result)