3 ms·
There are other, more subtle differences. In Python 3 this doesn't work. >>> filter(lambda (x, y): x > y, ((1, 2), (4, 3))) And 2.7 returns the filter resul
by pdknsk 12y ago
There are other, more subtle differences. In Python 3 this doesn't work.
>>> filter(lambda (x, y): x > y, ((1, 2), (4, 3)))
And 2.7 returns the filter result in the input type.
>>> filter(lambda x: x in 'ABC', 'ABCDEFA')
'ABCA'
In 3 it's an extra step.
>>> ''.join(filter(lambda x: x in 'ABC', 'ABCDEFA'))
'ABCA'