Menu
Coddy logo textTech

Unique Elements

Lesson 3 of 12 in Coddy's Python Interview Series course.

challenge icon

Challenge

Easy

Write a function unique_elements that takes a list and returns a new list with unique elements of the first list.

  • a1 - integer-array

And outputs an integer array, which contains unique elements of a given list


Example:

Input - [1,1,1,1,2,2,3,3,3,3,4,5]

Expected Output - [1, 2, 3, 4, 5]

Try it yourself

def unique_elements(a1):
    # Write code here

All lessons in Python Interview Series