Leetcode Palindrome In Python Using Function