It is possible...
<div tal:define="ignored python:request.set('sumVar', 0)">
but not recommended. The kind of logic you are trying to wedge into the
template should be pushed out into a Python script, leaving the template
only with the job of rendering the results.
Tres.
- --