def is_palindrome(s):
i = <NUM_LIT:0><EOL>j = len(s)-<NUM_LIT:1><EOL>while i < j:<EOL><INDENT>while i < j and not s[i].isalnum():<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>while i < j and not s[j].isalnum():<EOL><INDENT>j -= <NUM_LIT:1><EOL><DEDENT>if s[i].lower() != s[j].lower():<EOL><INDENT>return False<EOL><DEDENT>i, j = i+<NUM_LIT:1>, j-<NUM_LIT:1><EOL><DEDENT>return True<EOL>
:type s: str
:rtype: bool