How can I compare two functions and what is the better way to do it?


#1

How can I compare two functions and what is the better way to do it ?

def cheapest_shipping(weight):
gs = ground_shipping(weight)
ds = drone_shipping(weight)
if(gs < ds):
return cost

The code above is returning " line 42, in cheapest_shipping if(gs < ds): TypeError: unorderable types: tuple() < float()"

What is wrong ?

Thank you Guys


#2

It looks like one of your functions is returning a tuple and the other a float. Be sure they are both returning the same type of object.