Can I know where I have gone wrong here


this is a project from functions called sal’s shipping form python 3 course.
please let me know where I went wrong in this.

Are you getting any error messages? Analyzing those might really help you find the error by yourself :wink:

1 Like

no. there is no error. it just displays NONE.

I believe this part of the code should not be indented

if ground_shipping_charges <= premium_shipping_charges and ground_shipping_charges <= drone_shipping_charges :
      print("The cheapest shipping is ground shipping and the cost is " + str(ground_shipping_charges) +" dollars.")
    elif drone_shipping_charges <= ground_shipping_charges and drone_shipping_charges<= premium_shipping_charges:
      print("The cheapest shipping is drone shipping and the cost is " + str(drone_shipping_charges) +" dollars.")
      print("The cheapest shipping is premium shipping and the cost is " + str(premium_shipping_charges) +" dollars.")

You have those conditions inside your last else statement, so you’re only telling the user which shipping method is the best when the package is a certain weight.

Hope this helped.


It might be helpful to revisit how to use if elif else

And, you might need more than one function for this exercise.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.