理解python的可变参数

str.format(*args,**kwargs) 为例。

"type1:{},{},{},{}_type2:{a},{b},{c},{d}".format('a',2,*[3,4], a=21,b=22,**{'c':23,'d':24})

输出

'type1:a,2,3,4_type2:21,22,23,24'
posted @ 2016-07-07 20:04  bregman  阅读(196)  评论(0编辑  收藏  举报