title: Conditional list Python
body: <p>I am opening all the files present in zip, then converting the string to List and thereafter, breaking the list into 5 elements from each line.</p>
  <p><strong>My code:</strong></p>
  <pre><code>with zipfile.ZipFile(dummy.zip, 'r') as mz:
      for f in mz.namelist():
          data = mz.read(f).decode('utf-8').replace(&quot;\n&quot;, '').replace(&quot;\r&quot;, ',').lstrip().rstrip().split(&quot;,&quot;) #Removing all spaces and \r from text.
          allist = [data[i:i + 5] for i in range(len(data))[::5]] #breaking list into 5 elements each
  </code></pre>
  <p>I am able to do it perfectly if all values are present but if any of the element in missing on particular line then it picks up the value from second line but I want to add <code>NA</code> at place of missing element.</p>
  <p><strong>File data:</strong>
  <em>Dummy.zip = &quot;File1 + File2&quot;</em></p>
  <p><strong>File1:</strong></p>
  <pre><code>Yuli, yu@test.com, 0001, 8902
  Su, su@test.com, 0002, 8903, Manager
  </code></pre>
  <p><strong>File:2</strong></p>
  <pre><code>Zaon, zn@test.com, 100, 9087, Analyst
  June, ju@test.com, 278, 6078
  </code></pre>
  <p><strong>Purpose of the code:</strong></p>
  <p>I am adding converting this list to dict, so adding keys to each entry as <code>name, email, ext, Empid, Level</code></p>