我有一个列表,如果它有偶数个值,我想找到两个中间条目的中点。我是这样做的: if len(points) % 2 == 0:
l = (points[len(points)/2][1] + points[len(points)/2 + 1][1])/2但是,我收到一个错误消息:TypeError: list indices must be integers or slices, not float
添加回答
举报
0/150
提交
取消