Format nested list python
<pre><code>list=[['name1', 'maths,english'], ['name2', 'maths,science']]
</code></pre>

<p>I have a nested list that likes something like this, I am trying to work out how to format it so that the out put would be something like the following:</p>

<pre><code>name1, maths,english
name2, maths,science
</code></pre>

<p>I have tried using regex to no avail. How would I go about formatting or manipulating the list output to get something like the above?</p>

<p>Iterate over your groups and join the items from each group using a comma.</p>

<pre><code>groups = [['name1', 'maths,english'], ['name2', 'maths,science']]

for group in groups:
    print ', '.join(group)
</code></pre>

python