In Python, how can I pass an operator like + or < as a parameter to a function which expects a comparison function as a parameter?
def compare (a,b,f):
return f(a,b)
I have read about functions like __gt__() or __lt__() but still I was not able to use them.