No 'Solution' and 'Project Walkthrough' uses unknown code!?

I don’t understand why this particular Project unlike almost all the previous ones, doesn’t doesn’t have a solution to click for, a link to a related forum section and why the Walkthrough video uses codes that wasn’t taught earlier in the course!
That’s a lot to deal with as a beginner.

So first off, regarding the walkthrough video, the not covered code I’m talking about is HERE at 4:53 (should start there) and uses the % but not as it was taught previously, ie. Modulus. Don’t know what is going on there!?

I finally managed to solve this (with help from the walkthrough, by slightly differently). So I get the correct answer, but it’s followed by that annoying ‘None’.
Can someone please explain why?
Thanks!

def cheapest_shipping(weight):
  ground = cost_of_ground(weight)
  drone = cost_of_drone(weight)
  if (ground < drone) and (ground < premium_shipping):
    print("You should ship using ground shipping, it will cost $" +str(ground))
  elif (drone < ground) and (drone < premium_shipping):
    print("You should ship using drone shipping, it will cost $" +str(drone))
  else:
    print("You should ship using Premium Shipping, it will cost $" +str(premium_shipping))
    
print(cheapest_shipping(41.5))

This function doesn’t return anything, it only prints. By printing the function call (which, without a return statement, returns None), you’re printing None.

Either change the print statements inside your function to return the strings you generate, or remove the print statement at the bottom. Which you choose will depend upon what the assignment calls for.

Thanks! That worked :+1:

1 Like

agreed the video should be updated, using methods that haven’t been taught in the course yet surely isn’t the most optimal solution