2011年11月22日
摘要: 在python函数的形参表中接受tuple,使用asteroid。例如:>>> def profile(name,*ages): print name print ages >>> profile('Dush',12,23,34,45)Dush(12, 23, 34, 45)接受dictionary>>> def cart(**item): print item >>> cart(apples = 4, peaches = 5, beef = 44){'peaches': 5, 'a 阅读全文
posted @ 2011-11-22 17:10 bovine 阅读(1987) 评论(1) 推荐(0) 编辑