I have been going through the python course, and it seems that all of my elif statements always provide syntax errors, and it’s preventing me from running the code and seeing the output. In the error message, the caret always points to the “f” in elif. I am currently on the ground shipping project and running into the issue again.
Here is my code so far. I am only on step 3 where it has you test the math
weight = 6
Ground Shipping
if weight <= 2:
ground_ship = weight * 1.5 + 20
elif weight <= 6:
ground_ship = weight * 3 + 20
elif weight <= 10:
ground_ship = weight * 4 + 20
else:
ground_ship = weight * 4.75 + 20
print(ground_ship)
Below is the error message. this message post preview on the right puts the caret under the e, but in my editor it is under the f
File “shipping.py”, line 6
elif weight <= 6:
^
SyntaxError: invalid syntax