forked from cbreddy69/python-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshopping.py
More file actions
33 lines (23 loc) · 783 Bytes
/
shopping.py
File metadata and controls
33 lines (23 loc) · 783 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
# -*- coding: utf-8 -*-
choice = input("Are you a prime member (yes/no):")
amtPurchased = float(input(' Enter amount purchased '))
print(choice,amtPurchased)
def netAmount(amtPurchased,choice):
discount = 0
shipping = 0
netamt = 0
if (amtPurchased >= 30000):
discount = .3 * amtPurchased;
shipping = 300
elif (amtPurchased >20000 and amtPurchased <30000):
discount = .2 * amtPurchased;
shipping = 200
elif (amtPurchased <=20000):
discount = .1 * amtPurchased;
shipping = 100
if (choice == 'yes'):
shipping = 0
netamt = amtPurchased - discount + shipping
return netamt
netamt = netAmount(amtPurchased,choice)
print('net amount ',netamt)