When using includes within a for loop only the iterator variable can be accessed by the includes, it doesn't return a value for both global assigned variables and variables assigned within the loop.
HTML file
{% assign list = "1,2,3,4" | split: "," %}
{% for n in list %}
{% assign inner = n %}
{% include include.liquid %}
{% endfor %}
Liquid includes file
list: {{ list }} <br>
inner: {{ inner }} <br>
n: {{ n }}
<hr>
When using includes within a for loop only the iterator variable can be accessed by the includes, it doesn't return a value for both global assigned variables and variables assigned within the loop.
HTML file
Liquid includes file
Response