Elle Joy Vasquez
Preliminary Test 03
Create a Python function that takes a list and returns a new list with unique elements of the first list.
Sample List: [1,2,3,3,3,3,4,5]
Unique List: [1, 2, 3, 4, 5]
def unique_list(lst):
result = []
for el in lst:
if el not in result:
result.append(el)
return result
print(unique_list(input()))
Comments
Leave a comment