I can't understand wy this is wrong

https://www.codecademy.com/courses/learn-python-3/projects/sals-shipping
Hello! I try this to this exercise and i wrote the code below.
but it says:

line 34
elif premium < ground and premium < drone :
^
SyntaxError: invalid syntax

the line 34 is almost in the end in the def method_cost(weight):
and i can’t understand why.
also in the help video they have another code but i beleve also mine will be work. Am i right?
thanks a lot :slight_smile:

def ground_shipping(weight):
  if weight <= 2.00:
    ground_cost = weight * 1.50 + 20
  elif weight <= 6.00:
    ground_cost = weight * 3.00 + 20
  elif weight <= 10.00:
    ground_cost = weight * 4.00 + 20
  else:
    ground_cost = weight * 4.75 + 20
  return ground_cost
  
premium_ground_shipping = 125.00

def drone_shipping(weight):
  if weight <= 2.00:
    drone_cost = weight * 4.50
  elif weight <= 6.00:
    drone_cost = weight * 9.00
  elif weight <= 10.00:
    drone_cost = weight * 12.00
  else:
    drone_cost = weight * 14.25
  return drone_cost



def method_cost(weight):
	ground = ground_shipping(weight)
	premium = premium_ground_shipping
	drone = drone_shipping(weight)

	if ground < premium and ground < drone :
		print("the cheapest method is ground shipping and the price is " + str(ground)
	elif premium < ground and premium < drone :
		print("the cheapest method is premium ground shipping and the price is " + str(premium)
	else: 
		print("the cheapest method is drone shipping and the price is " + str(drone)

method_cost(4.8)```

When having a syntax error (especially when the syntax error is at the beginning of a line), also check the line above to make sure everything is closed (off) properly.

1 Like

you are right!! Thank you!