标签:strong on ad ef python c 对象 print it
可变参数
def enroll(name, gender, age=6, city=‘Beijing‘): print ‘name:‘, name print ‘gender:‘, gender print ‘age:‘, age print ‘city:‘, city
调用:
enroll(‘Bob‘, ‘M‘, 7)
enroll(‘Adam‘, ‘M‘, city=‘Tianjin‘)
定义默认参数要牢记一点:默认参数必须指向不变对象!
标签:strong on ad ef python c 对象 print it
原文地址:http://www.cnblogs.com/yipihema/p/4088974.html