forked from Codecademy/learn-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshipping.py
More file actions
33 lines (25 loc) · 786 Bytes
/
shipping.py
File metadata and controls
33 lines (25 loc) · 786 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
33
weight = 41.5
#Ground Shipping
flat_charge = 20
if weight <= 2:
cost_ground = weight * 1.5 + flat_charge
elif weight > 2 and weight <= 6:
cost_ground = weight *3 + flat_charge
elif weight > 6 and weight <= 10:
cost_ground = weight * 4 + flat_charge
else:
cost_ground = weight * 4.75 + flat_charge
print (f"Ground shipping cost: ${cost_ground:.2f}")
#Ground Shipping Premium
cost_ground_premium = 125.00
print (f"Ground shipping Premium cost: ${cost_ground_premium:.2f}")
#Drone Shipping
if weight <= 2:
cost_drone = weight * 4.5
elif weight > 2 and weight <= 6:
cost_drone = weight * 9
elif weight > 6 and weight <= 10:
cost_drone = weight * 12
else:
cost_drone = weight * 14.25
print (f"Drone shipping cost: ${cost_drone:.2f}")