-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSal's Shipping.py
47 lines (37 loc) · 1.1 KB
/
Sal's Shipping.py
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
def ground_shipping(weight):
if weight <= 2 :
price_per_pound = 1.50
elif weight <= 6 :
price_per_pound = 3.00
elif weight <= 10 :
price_per_pound = 4.00
else:
price_per_pound = 4.75
cost = 20 + (weight * price_per_pound)
return cost
cost_pr_ground_shipping = 125.00
def dron_shipping(weight):
if weight <= 2:
price_per_pounds = 4.50
elif weight <= 6:
price_per_pounds = 9.00
elif weight <= 10:
price_per_pounds = 12.00
else:
price_per_pounds = 14.25
cost = weight*price_per_pounds
return cost
def cheapset_shipping(weight):
ground = ground_shipping(weight)
dron = dron_shipping(weight)
premuim = cost_pr_ground_shipping
if ground < dron and ground < premuim:
cost = ground
return "You should ship using ground shipping, it will cost " + str(ground) + "$"
elif dron < ground and dron < premuim:
cost = dron
return "You should ship using dron shipping, it will cost " + str(dron) + "$"
else:
cost = premuim
return "You should ship using ground shipping, it will cost " + str(premuim) + "$"
print(cheapset_shipping(4.8))