125. 验证回文串


#!/usr/bin/env python
# -*- coding:utf-8 -*-
class Solution:
    def isPalindrome(self, s: str) -> bool:
        news = ''

        for i in s:
            if i.isalpha() or i.isdigit():
                news += i.capitalize()
        return news == news[::-1]
a=Solution().isPalindrome("1a2")
print(a)

Author: Lic
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source Lic !
  TOC