原书出处
Python Cookbook(第3版)中文版
,只要联合使用*和**即可。示例如下:
def anyargs(*args, **kwargs): print(args) # A tuple print(kwargs) # A dict 在这个函数中,所有的位置参数都会放置在元组args中,而所有的关键字参数都会放置在字典kwargs中。 7.1.3 讨论
在函数定义中,以*打头的参数只能作为最
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Python Cookbook(第3版)中文版/_epub-src/OEBPS/Text/part0013.xhtml
EPUB SHA-256:06e9310484dbd481a38263fd0ee26359bea9a3862a64cb4a53d4096b0f991e70