Created
April 11, 2016 11:30
-
-
Save valentinzberea/85014d6bba5ea3106ee1f38cfa22f9a6 to your computer and use it in GitHub Desktop.
Counting number of appearances
This file contains 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 collections import Counter | |
from random import randint | |
v = [randint(1, 10) for i in range(100)] | |
c = Counter(v) | |
for el in c.most_common(): | |
print(el) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment