标签:
float([x]): 将一个字符串或数转换为浮点数。如果无参数将返回0.0
>>> float(12) 12.0 >>> float(-122) -122.0 >>> float(‘ada‘) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: could not convert string to float: ada >>> float() 0.0 >>>
float([x]): 将一个字符串或数转换为浮点数。如果无参数将返回0.0
标签:
原文地址:http://www.cnblogs.com/blogofwyl/p/4658443.html