list-表-对象
a = [1,2,3]
print type(a)
print a
[root@localhost 3module]#python list.py
<type 'list'>
[1, 2, 3]
tuple-元组-函数包裹传递
def func(*name):
print type(name)
print name
func(1, 4, 6)
func(5, 6, 7, 8, 1, 2, 3)
[root@localhost 3module]#python baoguo-pass.py
<type 'tuple'>
(1, 4, 6)
<type 'tuple'>
(5, 6, 7, 8, 1, 2, 3)
dict-字典-包裹关键字传递
def func(**dict):
print type(dict)
print dict
func(a=5, b=9)
func(m=2,n=1,c=11)
[root@localhost 3module]#python baoguo-pass-key.py
<type 'dict'>
{'a': 5, 'b': 9}
<type 'dict'>
{'c': 11, 'm': 2, 'n': 1}