擅长:python、mysql、java
<p>这是使用<a href="https://docs.python.org/3/library/string.html#string.Formatter.format" rel="nofollow noreferrer">^{<cd1>}</a>和<a href="https://docs.python.org/3/library/stdtypes.html#str.join" rel="nofollow noreferrer">^{<cd2>}</a>的一种方法:</p>
<pre><code>list_names = ['Alex', 'John', 'Joseph J']
String_to_pring='Hi my name is (\\"{}\\")'.format('\\",\\"'.join(i for i in list_names))
# Hi my name is (\"Alex\",\"John\",\"Joseph J\")
</code></pre>