How to run two loop simeltanously in one loop in python
<p>Is there any way available to put two loops in one? I have:</p>

<pre><code>for getFeature in layerNameValueGetObj.getFeatures():
    for setFeature in layerNameValueSetObj.getFeatures():
</code></pre>

<p>I want to run <code>layerNameValueGetObj.getFeatures()</code> and <code>layerNameValueSetObj.getFeatures()</code> under one loop. How can I do this?</p>

<p>I don't want to nest them, I want to get both loop columns at a time.</p>

<p><code>itertools.product</code> exists for exactly this purpose</p>

<pre><code>import itertools

for getFeature, setFeature in itertools.product(layerNameValueGetObj.getFeatures(), layerNameValueSetObj.getFeatures()):
    # dostuff
</code></pre>

python