Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove repeated elements from list


# ----- Create a list with no repeating elements ------ #

mylist = [67, 7, 89, 7, 2, 7]
newlist = []

  for i in mylist: 
    if i not in newlist: 
        newlist.append(i)
 
PREVIOUS NEXT
Tagged: #python #remove #repeated #elements #list
ADD COMMENT
Topic
Name
2+3 =