1mylist = ["a", "b", "b", "c", "a"]
2mylist = sorted(set(mylist))
3print(mylist)
1
2 mylist = ["a", "b", "a", "c", "c"]
3mylist = list(dict.fromkeys(mylist))
4
5 print(mylist)
1# remove duplicate from given_list using list comprehension
2res = []
3[res.append(x) for x in given_list if x not in res]
1def unique_list(l):
2 ulist = []
3 [ulist.append(x) for x in l if x not in ulist]
4 return ulist
5
6a="calvin klein design dress calvin klein"
7a=' '.join(unique_list(a.split()))
1word = input().split()
2
3for i in word:
4 if word.count(i) > 1:
5 word.remove(i)
6
1tempA = []
2uniqueDict = dict()
3for key, val in thisdict.items():
4 if val not in tempA:
5 tempA.append(val)
6 uniqueDict[key] = val
7