title: Sum elements of the list in Jinja 2
body: <p>I have list in Jinja2 that contain dicts in itself. Something like</p>
  
  <pre><code>items = [{'name':'name1', 'points':5}, {'name':'name2', 'points':7}, 
   {'name':'name3', 'points':2}, {'name':'name4', 'points':11}]
  </code></pre>
  
  <p>What I need is to get sum of all <strong>points</strong> and to print it somewhere later.</p>
  
  <p>Currently what I got is:</p>
  
  <pre><code>{% set points = 0 -%}
  {% for single_item in items -%}
      {% set points = points + single_item["points"] -%}
      {{points}}
  {% endfor %}
  {{ points }}
  </code></pre>
  
  <p>Result is: 5 12 14 25 0</p>
  
  <p>Is there any way that I can get that <strong>points</strong> outside of loop has value <strong>25</strong> (last value from the loop)?</p>