How to remove duplicates from list in Python

1 Answer

0 votes
lst = ["python", "java", "python", "c", "c", "php", "c"]

set = set(lst)
lst = list(set)

print(lst)



'''
run:

['python', 'java', 'c', 'php']

'''

 



answered Oct 24, 2020 by avibootz
...