title: how to solve "jinja2.exceptions.UndefinedError: 'zip' is undefined"
body: <p>I'm working on a mathematical app that takes some inputs from the users and outputs a table of a mathematical relationship using flask and this error occurs :
  jinja2.exceptions.UndefinedError: 'zip' is undefined</p>
  
  <pre><code>File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 2309, in __call__
  return self.wsgi_app(environ, start_response)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 2295, in wsgi_app
  response = self.handle_exception(e)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 1741, in handle_exception
  reraise(exc_type, exc_value, tb)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\_compat.py", line 35, in reraise
  raise value
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 2292, in wsgi_app
  response = self.full_dispatch_request()
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
  reraise(exc_type, exc_value, tb)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\_compat.py", line 35, in reraise
  raise value
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
  rv = self.dispatch_request()
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\app.py", line 1799, in dispatch_request
  return self.view_functions[rule.endpoint](**req.view_args)
  File "C:\Users\A.Toba\Desktop\Flask\simple\main.py", line 6, in index
  return render_template('index.html')
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\templating.py", line 135, in render_template
  context, ctx.app)
  File "C:\Python37\Scripts\venv\lib\site-packages\flask\templating.py", line 117, in _render
  rv = template.render(context)
  File "C:\Python37\Scripts\venv\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
  return original_render(self, *args, **kwargs)
  File "C:\Python37\Scripts\venv\lib\site-packages\jinja2\environment.py", line 1008, in render
  return self.environment.handle_exception(exc_info, True)
  File "C:\Python37\Scripts\venv\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
  reraise(exc_type, exc_value, tb)
  File "C:\Python37\Scripts\venv\lib\site-packages\jinja2\_compat.py", line 37, in reraise
  raise value.with_traceback(tb)
  File "C:\Users\A.Toba\Desktop\Flask\simple\templates\index.html", line 55, in top-level template code
  {% for i, j in zip(pwf_table,q_table) %}
  </code></pre>
  
  <p>main.py</p>
  
  <p>in this file I was trying to take user inputs from the template form and put their values into variables and apply some python code on these values and send back the result to be published in a table in the same page.</p>
  
  <pre><code>from flask import Flask, render_template, request
  app = Flask(__name__)
  
  @app.route('/')
  def index():
     return render_template('index.html')
  
  @app.route('/',methods = ['POST', 'GET'])
  def result():
     if request.method == 'POST':
        Pr = request.form["pr"]
        Q = request.form["tq"]
        PWF = request.form["tpwf"]
        step = request.form["step"]
        pwf = list(range(0,Pr))
        q = []
        qmax = Q / (1 - 0.2*PWF/Pr - .8*(PWF/Pr)**2 )
        [q.append(qmax * (1 - 0.2*i/Pr - .8*(i/Pr)**2 )) for i in pwf ]
        pwf_table = pwf[::step]
        q_table = q[::step]
        return render_template("index.html",result = result)
  
  if __name__ == '__main__':
     app.run(debug = True)
  </code></pre>
  
  <p>in this bootstrap template I was trying to request data from user form to flask and sent the output to  a table in the same page that is generated by submitting the form</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --&gt;
      &lt;title&gt;Bootstrap 101 Template&lt;/title&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link href="\static\css" rel="stylesheet"&gt;
  
  
      &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
      &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --&gt;
      &lt;!--[if lt IE 9]&gt;
        &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"&gt;&lt;/script&gt;
        &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello, world!&lt;/h1&gt;
      &lt;form action="http://localhost:5000" method="POST"&gt;
        &lt;div class="form-group"&gt;
          &lt;label for=""&gt;Pr:&lt;/label&gt;
          &lt;input type="text" class="form-control" name="pr" id="pwd"&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="pwd"&gt;Test Q:&lt;/label&gt;
          &lt;input type="text" class="form-control" name="tq" id="pwd"&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="pwd"&gt;Test PWF:&lt;/label&gt;
          &lt;input type="text" class="form-control" name="tpwf" id="pwd"&gt;
        &lt;/div&gt;
        &lt;div class="form-group"&gt;
          &lt;label for="pwd"&gt;Table step:&lt;/label&gt;
          &lt;input type="text" class="form-control" name="step" id="pwd"&gt;
        &lt;/div&gt;
        &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
     &lt;/form&gt;
  
  
     &lt;div class="container"&gt;
    &lt;h2&gt;Striped Rows&lt;/h2&gt;
    &lt;p&gt;The .table-striped class adds zebra-stripes to a table:&lt;/p&gt;
    &lt;table class="table table-striped"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;PWF&lt;/th&gt;
          &lt;th&gt;Q&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        {% for i, j in zip(pwf_table,q_table) %}
          &lt;tr&gt;
            &lt;th&gt;i&lt;/th&gt;
            &lt;th&gt;j&lt;/th&gt;
          &lt;/tr&gt;
        {% endfor %}  
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>how to solve this error</p>