Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

unique lits on python

my_list  = [1,1,2,3,2,1,5]

# A set contains unique elements of which the order is not important
unique = list(set(my_list))

print(unique)
# Important: initial order might not be respected
# Output: [1,3,2,5]
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #unique #lits #python
ADD COMMENT
Topic
Name
7+1 =