Every line of 'python list unique' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
7 def unique1(lst): 8 outputList = [] 9 for el in lst: 10 if el not in outputList: 11 outputList.append(el) 12 print(outputList)
15 def unique2(lst): 16 myset=set(lst) 17 print(list(myset))
7 def is_unique_list(seq): 8 for i in seq: 9 if seq.count(i) != 1: 10 return False 11 return True
15 def unique(list1): 16 # init a null list 17 unique_list = [] 18 # traverse for all elements 19 for x in list1: 20 # check if exists in unique_list or not 21 if x not in unique_list: 22 unique_list.append(x) 23 return unique_list