依次输出多维数组里面的的单个元素
#-*- coding=utf-8 -*-
#依次输出多维数组里面的的单个元素
lista=[1,3,[4,5,6,[7,8,[9,10]]]]
for i in lista:
if isinstance(i,list):
for j in i:
if isinstance(j,list):
for k in j:
if isinstance(k,list):
for m in k:
print m
else:
print k
else:
print j
else:
print i
输出:
1
3
4
5
6
7
8
9
10