Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask Basics Character Builder Looping Through Items


I have been pulling my hair out for twenty minutes trying to solve this. I can't look at the options file to see what data I should be accessing, and the question is so vague I can't figure out what I am missing. According to this question I should be able to imbed a for loop as "for item in options" and then do <li>item to complete this challenge. But if I do that I get a parse error on line 19 which neither page of this challenge has 19 lines of code, and if I change the "options" in the for loop to "options[]" then it says its not printing enough lines of <li>, 0 lines found.

from flask import Flask, render_template

from options import OPTIONS

app = Flask(__name__)

def index():
    return render_template('options.html', options=OPTIONS)
  {% for name in options %}
    <li>{{ name }}
  {% endfor %}

Thanks yeah I finally figured that out, but I was also missing something else too so it kept failing on me.

1 Answer

Hello, Here is a hint. Whenever you open something you have to close it, for example You opened <ul> and you closed it</ul>. Hope this helps.