首页 > 编程语言 > 详细

Python create func

时间:2015-09-15 18:18:33      阅读:144      评论:0      收藏:0      [点我收藏+]
>>> movies =[
    "the holy grail", 1975,"terry jones",91,
    ["graham chapman",
     ["michel palin","john cheelse","terry gilliam","eric idle","terry jones"]]]
>>> def print_lol(the_list):
    for each_item in the_list:
        if isinstance(each_item,list):
            print_lol(each_item)
        else:
            print(each_item)

            
>>> print_lol(movies)
the holy grail
1975
terry jones
91
graham chapman
michel palin
john cheelse
terry gilliam
eric idle
terry jones

 

Python create func

原文:http://www.cnblogs.com/oskb/p/4810611.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!