#看看字典怎么个传法db = {' name ': ' Toby ', ' age ': +, ' phone ': ' 119 '}def Show (**dicts): for key in Dicts:print (Key,dicts[key]) s How (**DB) #接受字符串, tuples, lists, dictionaries (Python is too tmd) db = {' name ': ' Tantianran ', ' age ': ' Phone ': ' 15915822634 '}def show (AG, *args , **dicts): Print (' AG: ', ag) print (' args: ', args) for key in Dicts:print (Key,dicts[key]) show ("Hello word!" , 520,988,[1,2,3], ("abc", **DB), the result of the operation is as follows: Ag:hello Word!args: (520, 988, [1, 2, 3], (' abc ',)) phone 15915822634name ta Ntianranage 25# from the result can quickly see that the thing passed in is by which formal parameter to accept
This article is from the "Fa&it-Q Group: 223843163" blog, please be sure to keep this source http://freshair.blog.51cto.com/8272891/1870373
How Python dictionaries are passed to functions and functions accept a hodgepodge