title: How to unpack a list of lists?
body: <p>This may be a duplicate question, but I want to find out is there a way to unpack a list of lists and make a variable from an unpacked result? I have a data in the file  like: </p>
  
  <pre><code>'[416213688, 422393399, 190690902, 81688],| [94925847, 61605626, 346027022],| [1035022, 1036527, 1038016]'
  </code></pre>
  
  <p>So I open a file and make it a list</p>
  
  <pre><code>with open ('data.txt', "r") as f:
     a = f.read()
  a = a.split("|")
  print(*a)
  </code></pre>
  
  <p>Output: </p>
  
  <p><code>[416213688, 422393399, 190690902, 81688],  [94925847, 61605626, 346027022],  [1035022, 1036527, 1038016]</code></p>
  
  <p>This is the output I need for next step of my program. 
  But I can't make this result <code>a</code> variable for using it further. It gives me a <code>SyntaxError: can't use starred expression here</code> if I try:</p>
  
  <pre><code>a = (*a) 
  </code></pre>
  
  <p>I tried making it by using <code>zip</code>, but it gives me incorrect output, similar to what is described in the question <a href="https://stackoverflow.com/questions/19278084/zip-function-giving-incorrect-output"><strong>zip function giving incorrect output</strong></a>.</p>
  
  <pre class="lang-none prettyprint-override"><code>&lt;zip object at 0x0000000001C86108&gt;
  </code></pre>
  
  <p>So is there any way to unpack a list of list and get an output like: </p>
  
  <pre><code>[1st list of variables], [2nd  list of variables], [etc...]
  </code></pre>
  
  <p>if i use  itertools i get: </p>
  
  <pre><code>   l = list(chain(*a))
     Out: ['[', '4', '1', '6', '2', '1', '3', '6'...
  </code></pre>
  
  <p>that is not required</p>
  
  <p>So the working option is <a href="https://stackoverflow.com/a/46146432/8589220">https://stackoverflow.com/a/46146432/8589220</a>: </p>
  
  <pre><code> row_strings = a.split(",| ")
   grid = [[int(s) for s in row[1:-1].split(", ")] for row in row_strings]
   print(",".join(map(str, grid)))
  </code></pre>