title: Iterating over multiple lists in python - flask - jinja2 templates
body: <p>I am facing an issue in Iterating <code>for loop</code> over multiple lists in flask jinja2 template. </p>
  
  <p>My code is something looks like below</p>
  
  <pre><code>Type = 'RS'
  IDs = ['1001','1002']
  msgs = ['Success','Success']
  rcs = ['0','1']
  return render_template('form_result.html',type=type,IDs=IDs,msgs=msgs,rcs=rcs)
  </code></pre>
  
  <p>I am not sure of coming up with correct template so far,</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Response&lt;/title&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Type - {{Type}}!&lt;/h1&gt;
      {% for reqID,msg,rc in reqIDs,msgs,rcs %}
      &lt;h1&gt;ID - {{ID}}&lt;/h1&gt;
      {% if rc %}
      &lt;h1&gt;Status - {{msg}}!&lt;/h1&gt;
      {% else %}
      &lt;h1&gt; Failed &lt;/h1&gt;
      {% endif %}
      {% endfor %}
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Output I am trying to get is something like below in html page</p>
  
  <pre><code>Type - RS
   ID   - 1001
   Status - Failed
  
   ID   - 1002
   Status - Success
  </code></pre>