Format string in python list
<p>I have a list which should contain string with a particular format or character i.e. <code>{{str(x), str(y)},{str(x), str(y)}}</code>. I tried to do string concat like: <code>"{{"+str(x), str(y)+"},{"+str(x), str(y)+"}}"</code> and append to list, but it gets surrounded by brackets: [<code>({{str(x), str(y)}),({str(x), str(y)}})</code>]
How can I get rid of the brackets or betterstill, is there a better approach to having a list without brackets like this: <code>[{{string, string},{string, string}}]</code></p>

<p>The parentheses are because you're creating a tuple of three items:</p>

<ul>
<li><code>"{{"+str(x)</code></li>
<li><code>str(y)+"},{"+str(x)</code></li>
<li><code>str(y)+"}}"</code></li>
</ul>

<p>Try replacing those bare commas between <code>str(x)</code> and <code>str(y)</code> with <code>+","+</code>:</p>

<pre><code>"{{"+str(x)+","+str(y)+"},{"+str(x)+","str(y)+"}}"
</code></pre>

python