cf1aqtt5/ #6
Replies: 1 comment 1 reply
-
|
最后一个代码块 print(a) 的结果应为 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
cf1aqtt5/
不定长参数 print 函数是如何接收不定数量的参数的? 让我们定义这样一个函数: args 是一个变量名,在前面加上 *,接收所有的参数,保存为元组(即不可更改的列表)。我们可以通过常规的列表访问方式去访问 args 中的元素。 类似地,我们可以通过加上 ** 接收形如 a=b 的传参: 可以看到,此处 kwargs 的类型是一个字典。 我们来看一下...
https://python.yxzl.dev/cf1aqtt5/
Beta Was this translation helpful? Give feedback.
All reactions