Sal's Shipping: The output is incorrect [SOLVED]

``````weight = 8.4

# Ground Shipping
if weight <= 2:
cost_ground = weight * 1.5 + 20
elif weight > 2 <= 6:
cost_ground = weight * 3.0 + 20
elif weight > 6 <= 10:
cost_ground = weight * 4.0 + 20
else:
cost_ground = weight * 4.75 + 20

print(cost_ground)
``````

When I test my code and input 8.4, I get 45.2 when the correct answer is 53.6.
screenshot

What did I do wrong?

EDIT: Nevermind! Just corrected the order of my inequalities, heh.

``````weight = 8.4

# Ground Shipping
if weight <= 2:
cost_ground = weight * 1.5 + 20
elif weight <= 6 > 2:
cost_ground = weight * 3.0 + 20
elif weight <= 10 > 6:
cost_ground = weight * 4.0 + 20
else:
cost_ground = weight * 4.75 + 20

print(cost_ground)
``````

Now it correctly shows 53.6.

Updated my code (simplified the inequality) and finished the exercise:

``````weight = 41.5

print("Weight (in lb):", weight)

# Ground Shipping
if weight <= 2:
cost_ground = weight * 1.5 + 20
elif weight <= 6:
cost_ground = weight * 3.0 + 20
elif weight <= 10:
cost_ground = weight * 4.0 + 20
else:
cost_ground = weight * 4.75 + 20

print("Ground Shipping \$", cost_ground)

# Drone Shipping
if weight <= 2:
cost_drone = weight * 4.5 + 0
elif weight <= 6:
cost_drone = weight * 9.0 + 0
elif weight <= 10:
cost_drone = weight * 12.0 + 0
else:
cost_drone = weight * 14.25 + 0

print("Drone Shipping \$", cost_drone)
``````

However, I do not know how to compare which shipping method is cheapest. How do you code that?