标签:for end 默认 缺省 level lis evel eve 注释
1.注释
2.缩进
代码:
def print_lol(the_list,level=0):
for each_item in the_list:
if isinstance(each_item,list):
print_lol(each_item,level+1)
else:
if ind:
for tab_stop in range(level):
print("\t",end=‘‘)
print(each_item)
3.增加缺省默认值:
def print_lol(the_list,ind=False,level=0):
for each_item in the_list:
if isinstance(each_item,list):
print_lol(each_item,ind,level+1)
else:
if ind:
for tab_stop in range(level):
print("\t",end=‘‘)
print(each_item)
标签:for end 默认 缺省 level lis evel eve 注释
原文地址:http://www.cnblogs.com/joechiu/p/6265468.html