title: Using list to traverse list of lists
body: <p>I want to traverse list, and for each element of the list I have to traverse respective element of the other list of lists in jinja2.</p>
  
  <p>The lists:</p>
  
  <pre><code>devices=["device1","device2","device3"]
  device_ports=[["device1port1","device1port2"],["device2port1","device2port2"],["device3port1","device3port2"]]
  </code></pre>
  
  <p>Jinja Template:</p>
  
  <pre><code>{% for device,device_port in devices,device_ports %}
    {% for port in device_port %}
       {{device}} {{port}}
    {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>Expected Template Output:</p>
  
  <pre><code>device1 device1port1
  device1 device1port2
  device2 device2port1
  device2 device2port2
  device3 device3port1
  device4 device4port2
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>ValueError: too many values to unpack (expected 2)</p>
  </blockquote>