Answer to Question #335759 in Python for Elle Joy

Question #335759

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]

1
Expert's answer
2022-05-01T19:06:14-0400

def unique_list(lst):

  result = []

  for el in lst:

    if el not in result:

      result.append(el)


  return result


print(unique_list(input()))



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS