nested list flask 1

nested list flask

    {% for teacher in teachers %}
  • {{ teacher.name }}

      {% for x in teacher.name.courses %}
    • {{ x }}
    • {% endfor %}
  • {% endfor %}

Here is what the above code is Doing:
1. We’re looping through the teachers list.
2. For each teacher, we’re printing out the teacher’s name.
3. We’re looping through the courses that the teacher teaches.
4. For each course, we’re printing out the course name.

Similar Posts