码迷,mamicode.com
首页 > 编程语言 > 详细

Python create func

时间:2015-09-15 18:20:01      阅读:218      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!