Created
December 4, 2018 17:27
-
-
Save ltoshea/414a37a0418a70cf12b4c40c5a47ba49 to your computer and use it in GitHub Desktop.
Counts the number of the same numbers e.g. ar = [10,20,30,40,30]
Counter(ar) // {10:1, 20:1, 30:2, 40:1}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collection import Counter | |
| ar = [10,20,30,40,40] | |
| Counter(ar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment