if __name__ == '__main__': listM=[[1,2,3],[4,5,6],[7,8,9],['恭喜发财','一定暴富']] print(f'listM二重列表:{listM}') for i in listM: print (f'第{listM.index(i)+1}个:{i}',end=':') for j in i: print (j,end=' ') print()
最简单的遍历方法
for data in list
print data
索引:list.index(data)