I have been struggling with this longer than I am happy to admit and have just about given up. can someone please point out why I keep getting this error. It is driving me insane. I’ve watched the help video and It doesn’t look too dissimilar, but I don’t want to just copy it and be left not knowing why mine doesn’t work.
Traceback (most recent call last):
File “script.py”, line 46, in
File “script.py”, line 37, in customer_package_cost
if drone < ground and drone < premium:
TypeError: ‘<’ not supported between instances of ‘function’ and ‘function’
My problematic code:
def customer_package_cost(weight): drone = drone_shipping_cost ground = ground_shipping_cost premium = premium_ground_cost if drone < ground and drone < premium: return "The cheapest method for shipping this item is Drone shipping. Costing $" + drone + "." elif ground < drone and ground < premium: return "The cheapest method for shipping this item is Ground shipping. Costing $" + ground +"." else: return "The cheapest method for shipping this item is Premium ground shipping. Costing $" + premium + "." print(customer_package_cost(8.4))
My ‘understanding’ of the error:
I think/thought it was was flagged due to me using “<” with two variables but I’ve tried multiple things and cannot for the life of me figure out what is wrong. I’ve checked the help video he is also comparing variables. I’ve now played with/altered this code so many times I’m on the verge of copying the video completely and moving on with no further understanding of what went wrong.
any help would be greatly appreciated