65. 有效数字 个人感觉这种题目没太有意思 class Solution: def isNumber(self, s: str) -> bool: if s in ["inf", "-inf", "+inf", "Infinity", "+Infinity", "-Infinity"]: return False try: float(s) except: return False else: return True