DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python counter to list of tuples
from collections import Counter result = list(Counter(example).items()) [('apple', 2), ('pear', 1)]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#python
#counter
#list
#tuples
ADD COMMENT
Topic
COMMENT
Name
5+1 =
Submit