def foo(a): return filter(lambda x: a.count(x) > 1, a) print foo([5, 8, 5, 5, 8, 4])
Standard input is empty
[5, 8, 5, 5, 8]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!