为什么会出现此错误?需要帮助

时间:2019-11-24 11:51:19

标签: python

我收到此错误。代码未提交 需要帮助,在此先感谢

enter image description here

1 个答案:

答案 0 :(得分:2)

我相信您的错误在于找到中点。

在python中,如果我们使用 displayFn(id?: number): string | undefined { if (!id) return undefined; let index = this.options.findIndex(options => options.id === id); return this.options[index].fullName; } ,它将返回浮点值。

列表的索引不能是浮点值。

将行更改为:

len(lst)/2

这将返回一个Integer值作为输出。