> >def is_palidrome (n): > > return str(n) == ''.join (reversed (str(n))) > > >which will return True if integer n is a palidromic or False > >otherwise. > > I wouldn't normally provide a direct solution to this type of request; but > since you have, may I suggest: > > def is_palindrome (n): > return str(n) == str(n)[::-1]
http://gumuz.nl/weblog/python-trick-sequence-reversal/ -- http://mail.python.org/mailman/listinfo/python-list