We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Collections
- Company Logo
- Discussions
Company Logo
Company Logo
Sort by
recency
|
1186 Discussions
|
Please Login in order to post a comment
!/bin/python3
import math import os import random import re import sys from collections import Counter if name == 'main': s = input() s=list(s) s.sort() s=''.join(s) C=Counter(s) s=C.most_common(3) for element in s: print(element[0],element[1])
I learned through this problem that
https://docs.python.org/3.11/howto/sorting.html#sort-stability-and-complex-sorts