擅长:python、mysql、java
<p>这就是你要找的东西吗?在</p>
<pre><code>def helper_function(my_list):
for item in my_list:
if isinstance(item, basestring):
do_something(item)
else:
helper_function(item)
</code></pre>
<p>如果列表中的项是字符串,则对其运行函数。如果不是这样,那么您只需对该项再次调用helper函数,因为它接受任何包含字符串的任意列表。在</p>