我的代码“列表索引必须是整数,没有列出”,而accesing名单
v_recorrido= [[4, 45], [4, 15], [4, 45]]
t=0
for i in v_recorrido:
seg = 60*v_recorrido[i][0] + v_recorrido[i][1]
此行的列表元素都扔我这个错误:
TypeError: list indices must be integers, not list
为什么?我是Python的新手(主要来自C++),但我已经检查了文档的语法,它似乎是正确的。
你有抬头的'for'语句[文件](https://docs.python.org/3/reference/compound_stmts.html#the-for-statement)?或者检出[教程](https://docs.python.org/3/tutorial/controlflow.html#for-statements)?这种行为被极其彻底地记录下来。 – TigerhawkT3
将这个问题的确切标题放入Google搜索中,而不是SO的“提问问题”框也会很有用。 – TigerhawkT3