valid number

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
https://leetcode.com/problems/valid-number/description/
"""


class (object):
def isNumber(self, s):
"""
:type s: str
:rtype: bool
"""
try:
float(s.strip())
return True
except Exception:
return False