405 B
405 B
title, tags, expertise, firstSeen, lastUpdated
| title | tags | expertise | firstSeen | lastUpdated |
|---|---|---|---|---|
| Unique elements in list | list | beginner | 2018-10-09T20:01:19+03:00 | 2020-09-15T16:13:06+03:00 |
Returns the unique elements in a given list.
- Create a
setfrom the list to discard duplicated values, then return alistfrom it.
def unique_elements(li):
return list(set(li))
unique_elements([1, 2, 2, 3, 4, 3]) # [1, 2, 3, 4]