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 uniq_numbers(lst:list) -> list: res = [] for num in lst: if num not in res: res.append(num) return res print(uniq_numbers([1,2,3,3,3,3,4,5]))
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments