[palindrome] Updated the python example program