We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"""To find the number of times characters are repeated in a string """
from collections import Counter
Counter('abracadabra').most_common(3)
Counter('abracadabra').most_common(1)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
! /usr/bin/env python3
"""To find the number of times characters are repeated in a string """
from collections import Counter
Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
The argument of most_common is the number of items to be returned
Default will return count for all characters
Counter('abracadabra').most_common(1)
[('a', 5)]
The text was updated successfully, but these errors were encountered: