擅长:python、mysql、java
<p>你几乎没有选择。<br/>
你可以使用</p>
<pre><code>def foo(my_list): # pass a list as an argument and iterate over elements
pass
</code></pre>
<p>或者</p>
^{pr2}$
<p>或者</p>
<pre><code>def foobar(**kwargs): # pass keyword arguments
for key in kwargs:
print(key, str(kwargs[key])) # will print key and value
# example
>>foobar(name="My name" surname="my last name", age=24, weight=80)
('name', 'My name')
('surname', 'my last name')
('age', '24')
('weight', '80')
</code></pre>