Login
|
Signup
langref.org
-
python
add..
all
clojure
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Access
Display the unique items in a list
Display the unique items in a list, e.g. given ages =
[18, 16, 17, 18, 16, 19, 14, 17, 19, 18]
, display the unique elements, i.e. with duplicates removed.
python
2.5.2
ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]
unique_ages = list(set(ages))
ages = [18, 16, 17, 18, 16, 19, 14, 17, 19, 18]
unique_ages = list(set(ages))
Submit a new solution for
python
There are 24 other solutions in
additional
languages (
clojure
,
cpp
,
csharp
,
erlang
...)