DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
rename duplicates in list python
[v + str(mylist[:i].count(v) + 1) if mylist.count(v) > 1 else v for i, v in enumerate(mylist)]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#rename
#duplicates
#list
#python
ADD COMMENT
Topic
COMMENT
Name
1+4 =
Submit