Sal's Shipping Exercise

Can someone please tell me what’s wrong with my code?
thank you for your patience <3

1 Like

You should isolate each method and see if it does what you want (test for different conditionals).

In general, it’s good to be as specific as possible when asking the question (so that you can get the best answer feedback). So if you still can’t find the issue after that, then that process should at least yield a more focused question. Part of the process of learning program at the beginning is learning habits for testing your code so that the issues that do come up are very specific (and therefore much more solvable).


Hey,thanks for replying !
Well,its only shows me the values 53.6 and 6.75 which are the answer for the ground_shipping function and the drone_shipping function,the problem is, I cant get the cheapest_shipping_method function to calculate the cheapest method( I copied what the instructor did,since I was hopeless) and I still cant get the cheapest shipping method to work

Ok now we’re getting closer!
So if the issue is in that method, here are some ideas:

  • do you have a clear idea of how the logic is being implemented?
  • do you have a clear idea of the statements that you’re asking the machine to do for you? here’s an example
if ground < drone and ground < premium:
    method : "Standart ground shipping"
    cost : ground

basically, if the logic holds, you are telling the machine to do: method : x cost: x…
is that what you want? have you ever tried doing that by itself and compiling?

(side note, you should probably use sublime or a similar text editor when working with these since it’s easier to edit and compile than the codeacademy workspace)