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

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -