python 中*号的作用
摘要:当我们使用函数时,需要传入不定个数的位置参数时,就可以使用*号表示,即*args,以元组形式传入;需要传入不定个数的关键字参数时,使用**表示,即**kwargs,以字典形式传入。 def func(*args,**kwargs): print(args) print(kwargs) func(1,
阅读全文
posted @ 2020-12-31 16:36
posted @ 2020-12-31 16:36
posted @ 2020-12-16 16:28
posted @ 2020-12-09 14:34
posted @ 2020-12-07 14:30