title: list comprehension for empty list python 3?
body: <p>I have an python 3 code as follow:</p>
  
  <pre><code>a = []
  b = [[0] * len(a[0]) for _ in range(len(a))]
  </code></pre>
  
  <p>The above code works fine, but the follow code does not work:</p>
  
  <pre><code>a = []
  m, n = len(a), len(a[0])
  </code></pre>
  
  <p><code>len(a[0])</code> apppears in both codes, why the list comprehension does not through <code>IndexError: list index out of range</code>. </p>
  
  <p>Thanks,</p>