Steady as a rock

…or so they say

 

Verveling en Python zijn een leuke combinatie

import sys
is_palindrome = lambda w: len(w) < 2 or w[0] == w[-1] and is_palindrome(w[1:-1])
map(lambda w: is_palindrome(w[:-1]) and sys.stdout.write(w), sys.stdin)

Palindroomchecker in 3 regels big_smile.png

Filed under : python
By Dennis Kaarsemaker
On December 7, 2005
At 15:49
Comments :
 

Leave a Reply