Suppose we have python list with duplicates content we need to remove duplicates from list we can use dict.fromkeys
mylist = [1, 2, 2, 3, 4] mylist = list(dict.fromkeys(mylist)) print(mylist)
Tutorialshore
Suppose we have python list with duplicates content we need to remove duplicates from list we can use dict.fromkeys
mylist = [1, 2, 2, 3, 4] mylist = list(dict.fromkeys(mylist)) print(mylist)