Skip to main content
added 20 characters in body
Source Link
beary605
  • 4.4k
  • 2
  • 26
  • 52

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).

Python 2.7 (52 51), Python 3 (48)

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))

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).

Python 2.7 (52 51), 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''.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).

added 149 characters in body
Source Link
beary605
  • 4.4k
  • 2
  • 26
  • 52

Python 2.7 (52 51), Python 3 (48)

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))

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).

Python (52 51)

I didn't expect it to be so short.

a=raw_input();print filter(lambda x:a.count(x)>1,a)

raw_input(): store input as a string (input() = eval(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).

Python 2.7 (52 51), Python 3 (48)

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))

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).

added 227 characters in body
Source Link
beary605
  • 4.4k
  • 2
  • 26
  • 52

Python (5252 51)

I didn't expect it to be so short.

a=raw_input();print filter(lambda x:a.count(x)!=1>1,a)

raw_input(): store input as a string (input() = eval(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).

Python (52)

I didn't expect it to be so short.

a=raw_input();print filter(lambda x:a.count(x)!=1,a)

Python (52 51)

I didn't expect it to be so short.

a=raw_input();print filter(lambda x:a.count(x)>1,a)

raw_input(): store input as a string (input() = eval(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).

Source Link
beary605
  • 4.4k
  • 2
  • 26
  • 52
Loading