Python 2.7 error: max() got an unexpected keyword argument 'key' -


    x = {1:2, 3:6, 5:4}     max(x, key=lambda i: x[i]) 

python 2.7 error:

    max() got unexpected keyword argument 'key' 

python throws similar error message when use min(). how can solve problem? thanks!!!


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -