擅长:python、mysql、java
<p>另一种方法是使用<a href="https://docs.python.org/3/library/stdtypes.html#str.join" rel="nofollow noreferrer">^{<cd1>}</a>方法:</p>
<pre><code>>>> t = 'Hello'
>>> ' '.join('{0}{0}'.format(t[i]) for i in range(len(t)))
'HH ee ll ll oo'
</code></pre>