Hi im attempting this taks and have written the following code but i keep getting the error: File “script.py”, line 31
return print("Ground shipping is cheapest, and costs £ "+ ground)
^
SyntaxError: ‘return’ outside function
this is my code:
def what_shipping_method(weight):
ground=cost_groundshipping(weight)
drone=cost_droneshipping(weight)
premium=cost_p_groundshipping
if ground< drone and ground< premium:
return print("Ground shipping is cheapest, and costs £ "+ ground)
if drone< ground and drone< premium:
return print(“Drone shipping is cheapest, and costs £”+ drone)
if premium< drone and premium< ground:
return print(“Premium ground shipping is cheapest, and costs £”+ premium)
any help is much appreciated
ps. all the return statements are indented by one space but i can’t get it to stay like that in this question