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?

from flask import Flask, render_template

from teachers import TEACHERS

app = Flask(__name__)

def index():
    return render_template("teachers.html", teachers=TEACHERS)
<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 %}

     {% endfor %}