Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Iteration over dictionary

{%- for drink_attribute, ingredient in drink.items() 
    if drink_attribute.startswith('strIngredient') and ingredient 
%}
  <td>{{ ingredient }}</td>
{%- endfor %}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Iteration #dictionary
ADD COMMENT
Topic
Name
3+1 =