valid number 发表于 2018-04-26 | 分类于 algorithm , leetcode | 阅读次数 | 12345678910111213141516"""https://leetcode.com/problems/valid-number/description/"""class Solution(object): def isNumber(self, s): """ :type s: str :rtype: bool """ try: float(s.strip()) return True except Exception: return False Donate WeChat Pay Alipay