Skip to main content
5 events
when toggle format what by license comment
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Nov 4, 2013 at 11:27 history edited tobias_k CC BY-SA 3.0
much shorter version
Nov 4, 2013 at 10:49 comment added tobias_k @GarethRees You are right! When I wrote this, I thought "this seems wrong, there has to be a better way" all the time, but did not catch it. Thanks! (Then again, this way there will always be only one max value, whereas there may be multiple.)
Nov 4, 2013 at 10:16 comment added Gareth Rees +1, but it seems wrong to me that you have one loop over ABCDE[i].values() to find maxclicks and then a second loop over ABCDE[i].items() to find the key. Better to do this in a single loop: k, maxclicks = max(ABCDE[i].items(), key=operator.itemgetter(1))
Nov 2, 2013 at 13:04 history answered tobias_k CC BY-SA 3.0