Can someone explain what im doing wrong on sals shipping project?

Hi, I’ve been trying to work out this project for a bit. I did everything to the likeliness of the “hints” that you’re given to help complete the tasks. when I watch the walkthrough video it didn’t make any sense to me because he was doing his tasks completely different from what was shown in the hints. can someone explain what I have wrong here?

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

Hello! Looks like you’ve got a few issues here.

The biggest one right now that I can see is that your statements currently say something like “if weight is greater than 2 or greater than or equal to 6,” which is… very odd. Anything above 6 would fit this… But anything between 2 or 6 may be throwing the program. Remember two things: first, that you’re looking for anything between 2 and 6lbs (a.k.a., greater than two and less than or equal to 6); and second, that control flow will check each statement in order (so if it fits the first criterium, it won’t continue checking, so your “or” statements are unnecessary).

Also, Python is very space/indentation-dependent! Make sure all your “cost_ground” declarations line up vertically.

Start with that, and if you still need help, let me know! I just don’t want to give all the answers right away, since puzzling it out yourself is the best way to learn. :wink:


Thank you for your reply. . I notice that I did have the less than and greater than signs mixed up. Thanks too for pointing out the indent mistake. that made sense that if it followed the statements from top to bottom I didn’t need the ‘or’ statements. However I’m still getting an invalid syntax error

Does it make sense to use a condition with else? An else is used to mean "everything else that hasn’t been specified by the above (if and elif) conditions.


my thought process was that the last statement needed include both else and that the weight needed to be over 10, but that makes sense now because <=2 includes everything else on the other side of the spectrum

1 Like