1 | initial version |
You can provide a key function to sort with, as follows (say you want the most frequent letter first):
sage: sorted(table, key=table.get, reverse=True)
['E',
'T',
'A',
'O',
'I',
'N',
'S',
'H',
'R',
'D',
'L',
'C',
'U',
'M',
'W',
'F',
'G',
'Y',
'P',
'B',
'V',
'K',
'J',
'Q',
'X',
'Z']
2 | No.2 Revision |
You can provide a key function to sort with, as follows (say you want the most frequent letter first):
sage: sorted(table, key=table.get, reverse=True)