def is_float(self, string):
"""
If the string is a float, returns
the float of the string. Otherwise,
it returns False.
"""
try:
return decimal.Decimal(string)
except decimal.DecimalException:
return False
评论列表
文章目录