Python(36)_循环打印列表中的列表

#-*-coding:utf-8-*-
'''
 打印列表,遇到列表中的列表也循环打印
'''
li = [1,2,3,[1,2,3,5,6],'hjaha']
lie = []
#print(type(li[0]))
#print(type(li))

for i in li:
        if type(i) != type(li):
            print(i)
        else:
            for j in i:
                print(j)

猜你喜欢

转载自www.cnblogs.com/sunnybowen/p/10205106.html