Apr-15-2020, 03:52 PM
Solution I came up with:
string ='red,red,white,white,pink,blue,white,white,blue,blue,white' wordlist = string.split(',') # print(wordlist) for word in wordlist: while wordlist.count(word) > 1: wordlist.remove(word) print(f'{wordlist}')
Output:['red', 'pink', 'blue', 'white']
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags