title: How to loop use jinja2 for loop to create a select element?
body: <p>Say I have a python list called seq and I want to render it in a select element how do I do that? </p>
  
  <p>I tried: </p>
  
  <pre><code>&lt;select name="Exercise1"&gt;
           {% for item in seq %}
              &lt;option  value="{{item}}"&gt;{{item}}&lt;/option&gt;
           {% endfor %}
           &lt;/select&gt;
  </code></pre>
  
  <p>it didn't work. </p>
  
  <p>UPDATE:
  here is the template code: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Unit 2 Rot 13&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;h2&gt;Enter some text to ROT13:&lt;/h2&gt;
      &lt;form method="post"&gt;
  
                   &lt;select name="Exercise1"&gt;
                {% for item in seq %}
                  &lt;option  value="{{item}}"&gt;{{item}}&lt;/option&gt;
               {% endfor %}
               &lt;/select&gt;
  
  
        &lt;br&gt;
        &lt;input type="submit"&gt;
  
      &lt;/form&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>and here is the rendered html source code: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Unit 2 Rot 13&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;h2&gt;Enter some text to ROT13:&lt;/h2&gt;
      &lt;form method="post"&gt;
  
                   &lt;select name="Exercise1"&gt;
  
                    &lt;/select&gt;
  
  
        &lt;br&gt;
        &lt;input type="submit"&gt;
  
      &lt;/form&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm not sure why the element just disappears and there is no errors raised.</p>