max(1,2,3, key=lambda x:-x) code example Example: python max function with lambda def winner(): w = max(players, key=lambda p: p.totalScore)