If you'd like to output a variable for debugging purposes within a Twig template, you can use DrupalX's dump statement if you are inside a statement block. The output is conveniently send to the JS console of your browser:
{%
for i in 0..10;
dump i;
endfor;
%}
Or you can use the dump filter if you want to dump something from an output block:
{% for i in 0..10 %}
{{ i | dump }}
{% endfor %}