title: How to write a for loop in gremlin?
body: <p>How do I write a <code>for</code> loop in gremlin? Something like:</p>
  <pre><code>for i=0;i&lt;10:i++:
    println hello number i
  </code></pre>
  <p>I also tried to iterate over nodes and call a function on each one e.g.(<code>count</code>):</p>
  <pre><code>gremlin&gt; g.v(782).in
  ==&gt; v[2746934]
  ==&gt; v[2581232]
  ==&gt; v[1554286]
  ==&gt; v[780]
  gremlin&gt; g.v(78).in.loop(2){it.loops &lt; 4}.count()
  ==&gt; class java.lang.NullPointerException : null
  </code></pre>
  <p>My main aim is to execute a for loop and print the value of nodes that have no <code>inE</code>. Which means the in degree of them is zero.</p>