功能和通话

列表作为参数只是另一个变量:

def func(myList):
    for item in myList:
        print(item)

并且可以在函数调用中传递:

func([1,2,3,5,7])

1
2
3
5
7

或者作为变量:

aList = ['a','b','c','d']
func(aList)

a
b
c
d