人生苦短,我用Python!
class Solution:
# @param {string} s the string that represents a number
# @return {boolean} whether the string is a valid number
def isNumber(self, s):
# Write your code here
num = None
try:
num = eval(s)
except:
pass
if num != None:
return True
return False