{% for a in list_a %}{% for b in list_b %} {% if forloop.counter == forloop.parentloop.counter %} {{a}} {{b}} {% endif %} {% endfor %}{% endfor %}