Remove duplicate strings
Write a Python program to remove duplicate strings from a list.
["python", "is", "a", "best", "language", "python", "best"]
['python', 'is', 'a', 'best', 'language']
Approach
dict.fromkeys.
Solution
words = ["python", "is", "a", "best", "language", "python", "best"]print(list(dict.fromkeys(words)))['python', 'is', 'a', 'best', 'language']
Learn the concept
New to this topic? Read the lesson, then come back.