float() 用于将一个对象转换为浮点数
In [37]: float(‘123‘) # 将纯数字的字符串转换为浮点数 Out[37]: 123.0 In [38]: float(123) # 将整数转换为浮点数 Out[38]: 123.0
float()
原文:https://www.cnblogs.com/pzk7788/p/10263803.html