Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Andy McDonald](https://secure.gravatar.com/avatar/2c7a70bb997cb62e77a9341481bf2b27?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Andy McDonald
Python Development Techdegree Graduate 13,801 PointsDont know HTML have no clue what im doing in flask.
First question. Is this homework trying to get me to make a list before I start running a for loop through it?
Second... am I doing the html portion right by simply opening and closing a list <li></li>?
Third... is this for loop correct? I've also tried print dict(option.items())['name'].
from flask import Flask, render_template
from options import OPTIONS
app = Flask(__name__)
@app.route('/')
def index():
return render_template('options.html', options=OPTIONS)
for option in OPTIONS:
print option.items()[0]
<ul>
<li>
</li>
</ul>
1 Answer
![Megan Amendola](https://uploads.teamtreehouse.com/production/profile-photos/7340382/micro_headshot.jpg)
Megan Amendola
Treehouse TeacherHi! The code challenge is asking you to use a Flask templating for loop. It wants you to loop through the options being passed into the template inside of the index function. All you need to do is create the loop notation inside of the HTML file, so you don't need to add anything to the python file app.py.
The video before this code challenge shows an example of writing the for loop at the beginning. Here are some examples from the documentation too.
I also highly suggest checking out the prerequisites for this course if you haven't already. They include some HTML courses.
Andy McDonald
Python Development Techdegree Graduate 13,801 PointsAndy McDonald
Python Development Techdegree Graduate 13,801 PointsI kinda want to focus on python for now. What would you suggest that I go to next?
Andy Hughes
8,479 PointsAndy Hughes
8,479 PointsAt around 3:43 in the video actually shows an example that is closer to the format asked for in the challenge. The bit I couldn't figure out and still can't is why I couldn't write {{ option }} and get the result. Instead I had to write it as {{ option.name }}. That is not covered or explained in the video.
I figure it's just the teacher trying to confuse us even more than he already has :P