how to use lambda for doing max in python code example Example: python max function with lambda def winner(): w = max(players, key=lambda p: p.totalScore)