擅长:python、mysql、java
<p>您可以使用<a href="http://docs.python.org/library/stdtypes.html#str.join" rel="nofollow">^{<cd1>}</a>。</p>
<pre><code>result = "i like the following fruits: "+', '.join(fruits)
</code></pre>
<p>(假设<code>fruits</code>只包含字符串)。如果<code>fruits</code>包含非字符串,则可以通过动态创建生成器表达式来轻松转换它:</p>
<pre><code>', '.join(str(f) for f in fruits)
</code></pre>