Q:

Jinja2 looping over list of dictionary items

I have a list of dictionary items I am looping over.
I can get the key which is the year, when I try to get the data in the dictionary it's printing the year again.
  [{'2020': [], '2019': ['05'], '2018': ['02', '01']}] 
  {% for d in  dirs %}
      {% for sd in d %}
     {{ sd }}
         {% for doy in sd %}   
            {{ doy }}<br>
         {% endfor %}<br><br>
    {% endfor %}
{% endfor %}

Whats is printing is 
 2020
 2
 0
 2
 0

2019
2
0
1
9

2018
2
0
1
8

What I want to print is
2020
2019
05
2018
02
01

A:

As mentioned above, you can achieve that by modifying your third loop. To simplify: 
list = [{'2020': [''], '2019': ['05'], '2018': ['02', '01']}]

Template:
{% for obj in list %}
  {% for obj2 in obj %}
    <p>{{ obj2 }}</p>
    {% for obj3 in obj[obj2] %}
     <p>{{ obj3 }}</p>
    {% endfor %}
  {% endfor %}
{% endfor %}

Output:
2020   
2019   
05   
2018  
02   
01

