-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBill amount.py
More file actions
26 lines (20 loc) · 1.03 KB
/
Bill amount.py
File metadata and controls
26 lines (20 loc) · 1.03 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
# This is a program to calculate the amount of your bill on shopping usinf nested if else statements
country = False
country = input("Please enter your country: ").upper()
purchase = float(input("Please enter the total amount of shopping you did: "))
if country == "CANADA":
country = True
if country:
province = input('Please enter your province(If not in Alberta or Ontario then please enter "other": ').upper()
if province == "ALBERTA":
value = purchase*0.05 + purchase
print('Tax here is 0.05 hence the total amount is {0:f}'.format(value))
elif province == "ONTARIO":
value1 = purchase*0.13 + purchase
print('Tax here is 0.13 hence the total amount is {0:f}'.format(value1))
elif province == "OTHER":
value2 = purchase*0.06 + purchase*0.05 + purchase
print('Tax here is 0.06 and 0.05 hence the total amount is {0:f}'.format(value2))
else:
print('No tax. Your total amount is {0:f}'.format(purchase))
print('Have a nice day!')