Python 2.7 (52 51), Python 3 (48)Python 3 (52)
I didn't expect it to be so short.
2.7: a=raw_input();print filter(lambda x:a.count(x)>1,a)
3.0: a=input();print(filter(lambda x:a.count(x)>1,a))
3.0: a=input();print''.join(i for i in a if a.count(x)>1)
raw_input()
: store input as a string (input()
= eval(raw_input())
)
(Python 3.0: input()
has been turned into raw_input()
)
filter(lambda x:a.count(x)>1,a)
:
Filter through all characters within a
if they are found in a
more than once (a.count(x)>1
).