Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New sals shipping #131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions 2-control-flow/sals-shipping/shipping.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
# Sal's Shipping
# Sonny Li

weight = 80

# Ground Shipping 🚚

if weight <= 2:
cost_ground = weight * 1.5 + 20
elif weight <= 6:
cost_ground = weight * 3.00 + 20
elif weight <= 10:
cost_ground = weight * 4.00 + 20
else:
cost_ground = weight * 4.75 + 20

print("Ground Shipping $", cost_ground)

# Ground Shipping Premimum 🚚💨

cost_ground_premium = 125.00

print("Ground Shipping Premimium $", cost_ground_premium)

# Drone Shipping 🛸

if weight <= 2:
cost_drone = weight * 4.5
elif weight <= 6:
cost_drone = weight * 9.00
elif weight <= 10:
cost_drone = weight * 12.00
else:
cost_drone = weight * 14.25

print("Drone Shipping: $", cost_drone)
weight = 41.5
ground_shiping_premium = 125.00

#ground shipping
def ground_shipping():
if weight <=2:
cost = weight * 1.50 + 20
return (cost)
elif weight <= 6:
cost = weight * 3.00 + 20
return (cost)
elif weight <= 10:
cost = weight * 4.00 + 20
return (cost)
else:
cost = weight * 4.75 + 20.00
return (cost)

#Drone shipping
def drone_shipping():

if weight <=2:
cost = weight * 4.50
return (cost)
elif weight <= 6:
cost = weight * 9.00
return (cost)
elif weight <= 10:
cost = weight * 12.00
return (cost)
else:
cost = weight * 14.25
return (cost)

#Dispaying
print("Your ground shipping cost is: " + str(ground_shipping()) + '$')
print("Your premium shipping cost is: " + str(ground_shiping_premium) +'$')
print("Your drone shipping cost is: " + str(round(drone_shipping(), 1)) + '$')