Leetcode Check Palindrome In Python Using Function