Troubleshooting

def shipping_cost_ground(weight):
  if weight <= 2:
    cost = 1.50
  elif weight <= 6:
    cost = 3.00
  elif weight <= 10:
    cost = 4.00
  else: 
    cost = 4.75
  
  return 20 + (weight * cost)

premium_shipping = 125.00

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

def cheapest_shipping_method(weight):
  
  ground = shipping_cost_ground(weight)
  premium = premium_shipping
  drone = shipping_cost_drone(weight)
  
  
  if ground < premium and ground < drone:
    method = "standard ground"
    price = ground
  elif premium < ground and premium < drone:
    method = "premium"
    price = premium
  else:
    method = "Drone"
  price = drone
  
  
  print("The cheapest shipping option available is " + str(price) + "$ with " + str(method) + " shipping.")
  
  
print(cheapest_shipping_method(100))

It prints this:
The cheapest shipping option available is 1425.0$ with premium shipping.
None

how come?

how does this differ from your expectations? You could start by checking what each print() statement outputs.

Premium shipping is set to 125.00. Why does it come up with 1425 ? the amount that it prints, is overruling the premium cost, despite being set to 125.00. I can’t quite figure out where the problem lies.

If you print out everything being done then you’ll find how it gets there right?

new to it. Still figuring it out. thx

1425 doesn’t come from thin air, so where would it come from? It sounds like drone shipping.

so your premium price gets overwritten by drone shipping, where could this happen?