CSS Flask Basics Character Builder Loop Nested Items

Assuming teachers is list of dicts with courses a list inside each dict. What am i doing wrong here?

What's wrong with this?

flask_app.py
from flask import Flask, render_template

from teachers import TEACHERS

app = Flask(__name__)


@app.route('/')
def index():
    return render_template("teachers.html", teachers=TEACHERS)
templates/teachers.html
<ul class="teachers">
    {% for teacher in teachers %}
      <li class="teacher"><h2>{{teacher.get("name")}}</h2>
        <ul class="courses">
           {% for course in teacher.get("courses") %}
          <li class="course"><span>{{course}}</span></li>
          {% endfor %}

        </ul>
      </li>
     {% endfor %}
</ul>