我收到此错误。代码未提交 需要帮助,在此先感谢
答案 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值作为输出。