📅  最后修改于: 2022-03-11 14:45:08.594000             🧑  作者: Mango
def is_number(n):
try:
float(n) # Type-casting the string to `float`.
# If string is not a valid `float`,
# it'll raise `ValueError` exception
except ValueError:
return False
return True