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

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

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.

1 Like