[palindrome] updated the python example program