我是python的新手。我有一个列表列表,需要遍历它们或编写一个简单的for循环(在下面的示例中,“数据”中有6个列表,但是我并不总是知道自己有多少个列表,所以我只需要迭代一下到最后)。我有下面的python代码
data=[['2', '33494.45', '91.415838', '0'], ['2', '33994.3', '101.1738', '0'], ['2','34494.15', '107.04941', '0'], ['2', '34994', '107.67817', '0'], ['2', '35493.85', '107.26302', '0'], ['2', '35500', '107.21114', '0'], ['2', '35993.7', '103.04895', '0']]
self.do_something(data[i])
我需要反复进行
self.do_something(data[0])
self.do_something(data[1])
self.do_something(data[2])
self.do_something(data[3])
self.do_something(data[4])
self.do_something(data[5])
self.do_something(data[6])
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句