请问吧友,错误could not convert string to float是怎么回事呢
python3吧
全部回复
仅看楼主
level 10
1k3l5j 楼主
如图所示,报错
但如果删掉input前的float,就没有问题,为什么呢
望解答,谢谢
2018年07月31日 10点07分 1
level 12
空字符串无法被转换成浮点数。
>>> float('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: could not convert string to float:
2018年07月31日 12点07分 2
明白了,谢谢
2018年07月31日 14点07分
level 6
不是纯数字的字符串,无法转为浮点型
2018年07月31日 12点07分 3
谢谢
2018年07月31日 14点07分
1