Python 3 Course- Sal's shipping project

Hey there,
trying to complete Sal’s shipping project as part of the ‘control flow’ chapter on the python course.
for some reason, when I run the code it returns me IndentationError.
adding here the code exactly as I wrote it, I will glad if anyone can solve and explain the error.

the error:

File “script.py”, line 22
elif weight <= 6:
^
IndentationError: unindent does not match any outer indentation level

the code:

ef gr_shipping(weight):

if weight <= 2:

price_per_lb = 1.50

elif weight <= 6:

price_per_lb = 3.00

elif weight <= 10:

price_per_lb = 4.00

else:

price_per_lb = 4.75

return 20 + (price_per_lb * weight)

print(gr_shipping(8.4))

pre_shipping = 125.00

def drone_shipping(weight):

if weight <= 2:

price_per_lb = 4.50

elif weight <= 6:

price_per_lb = 9.00

elif weight <= 10:

price_per_lb = 12.00

else:

price_per_lb = 14.25

return (weight * price_per_lb)

if weight <= 2: and elif weight <= 6: do not have the same indention level, there is one space difference.

4 Likes