title: NetLogo: storing variables in list and iterating through them
body: <p>I want to loop through a range of variables in NetLogo. Idea is that those values are inserted as variables in UI and those values are iterated through in <code>while</code> or <code>foreach</code> loop. Also how to get to each value - in Python it is easy as you iterate through them but if I use NetLogo then I have to take "item x in list", can I access variables in list same way? In Python it is like below:</p>
  
  <pre><code>variables = [x0, x1, x2, x3, x4]
  for x in variables:
      print (x)
  </code></pre>
  
  <p>Output is x0 to x4 as variables to use in code.</p>