Python 3.9.7
Running example code and getting the error: TypeError: max() got an unexpected keyword argument ‘key’
lis=[(101, 153), (255, 827), (361, 961)]
from operator import itemgetter
max(lis,key=itemgetter(1))[0]
>Solution :
Try:
import builtins
lis=[(101, 153), (255, 827), (361, 961)]
from operator import itemgetter
builtins.max(lis,key=itemgetter(1))[0]
If it works, it should confirm that you redefined max somewhere along the way.