【发布时间】:2022-10-13 17:26:04
【问题描述】:
我有以下说明
x1,y1,x2,y2,x3,y3,xp,yp = map(float, input().split())
当我尝试以小数值执行它时,例如8/3,我收到一条错误消息。
x1,y1,x2,y2,x3,y3,xp,yp = map(float, input().split())
0.1 0.2 -8 -16.67 0 0.1 8/3 1
# output
Traceback (most recent call last):
File "<pyshell#42>", line 1, in <module>
x1,y1,x2,y2,x3,y3,xp,yp = map(float, input().split())
ValueError: could not convert string to float: '8/3'
我在这里做错了什么?提前感谢您的任何帮助。
【问题讨论】:
标签: python input type-conversion