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

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)

 

posted @ 2014-09-07 20:30  拙急鸟  阅读(134)  评论(0编辑  收藏  举报