Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Get unique values from a Python list

# just turn it into a set and then convert again into a list
res = list(set(lst1)))
 
# now check the lengths of the two lists
print(len(res))
print(len(lst1))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Get #unique #values #Python #list
ADD COMMENT
Topic
Name
6+6 =