I'm trying to add variables in python embedded in my HTML and it just prints out the add statements instead of executing them. Here is my code from my html file:
<% x = 0 %>
{% for c in UGC %}
{% if c.doctor_id == doctor.id %}
<% {{x}} = {{x}} + {{c.time}} %>
<h4>Around {{c.time}} minutes.</h4>
<h4>{{c.comment}}</h4>
<h4>{{c.submitted_on}}</h4>
<br>
{% endif %}
{% endfor %}
{{c.time}} prints out the actual time from the database. {{c.comment}} and {{c.submitted_on}} print out the relevant comment and time stamp from the DB respectively. However, when I initialize x to 0 and then try to add time to it on every iteration of the loop, this is printed: '<% = + 33 %>' where 33 is the value of {{c.time}} for that iteration of the loop.