HCLTech interview question

Python code for Palindrome string