Python Flask Basics Character Builder Loop Nested Items

eitan hershko
eitan hershko
1,556 Points

Now add a new <ul> inside of the <li> with a class of "courses". Inside this <ul> loop through the teacher's 'courses' k

i cannot understand what i am doing wrong!

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>
      <h2> {{ teacher['name'] }} </h2>
      <ul class="courses">
        {% for course in teacher %}
          <li>{{ course['course'] }}</li>
        {% endfor %}
      </ul>
    </li>
  {% endfor %}

</ul>