Answers for "uniqe values in list python"

2

python add unique to list

myList = ['Arise', 'But', 'It', 'Juliet', 'Who', 'already', 'and', 'and', 'and', 
     'breaks', 'east', 'envious', 'fair', 'grief', 'is', 'is', 'is', 'kill', 'light', 
     'moon', 'pale', 'sick', 'soft', 'sun', 'sun', 'the', 'the', 'the', 
     'through', 'what', 'window', 'with', 'yonder']

auxiliaryList = []
for word in myList:
    if word not in auxiliaryList:
        auxiliaryList.append(word)
Posted by: Guest on May-20-2020
11

python list with only unique values

my_list = list(set(my_list))
Posted by: Guest on May-05-2020

Python Answers by Framework

Browse Popular Code Answers by Language