This is because u'9' > u'10'
, since they are strings.
To compare numerically, use int
as a key.
max(MyCount, key=int)
(Calling .keys()
is usually unnecessary)
This is because u'9' > u'10'
, since they are strings.
To compare numerically, use int
as a key.
max(MyCount, key=int)
(Calling .keys()
is usually unnecessary)