Here in this case, the function sort needs a object of a method. This obj is then executed within the sort() function. If u pass something like key=method() then ur not passing the method to the key , but ur passing the o/p of the method. In our case it's a number.. so the function will try something like 55() and will throw an error that integers cannot be called. I hope this helps