Skip to content

Instantly share code, notes, and snippets.

@valentinzberea
Created April 11, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valentinzberea/85014d6bba5ea3106ee1f38cfa22f9a6 to your computer and use it in GitHub Desktop.
Save valentinzberea/85014d6bba5ea3106ee1f38cfa22f9a6 to your computer and use it in GitHub Desktop.
Counting number of appearances
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