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

Learn Python From 'Head First Python' [1] : The List

时间:2014-09-07 21:00:15      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   ar   for   div   cti   sp   

1.the concept of List

2. how to define a method of myself

3.how to iterator a list

 

PS:

for Step 2,3. it is related with a key word: ‘def‘. we define a function like below.

def function name:

  XXXXX

e.g. list iterator :

1 def print_lol(the_list):
2     for each in the_list:
3         if isinstance(each,list):
4             print_lol(each)
5         else:
6             print(each)

 

Learn Python From 'Head First Python' [1] : The List

标签:style   blog   color   io   ar   for   div   cti   sp   

原文地址:http://www.cnblogs.com/zhuojiniao/p/3960548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!