Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find duplicate strings in a list of string python function

sam_list = [11, 13, 15, 16, 13, 15, 16, 11] 

print ("The list is: " + str(sam_list)) 

# to remove duplicates from list 

result = [] 

[result.append(x) for x in sam_list if x not in result] 

# printing list after removal 

print ("The list after removing duplicates: " + str(result))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #duplicate #strings #list #string #python #function
ADD COMMENT
Topic
Name
7+9 =