Loop character A/B alternately
<p>How can I print A/B character alternately in python loop?</p>

<p>What I expect in result:</p>

<pre><code>oneA
twoB
threeA
fourB
...
</code></pre>

<p>try this:</p>

<pre><code>l1 = ['A','B']
l2 = ['one','two','three','four']
for i,val in enumerate(l2):
    print(val + l1[i%len(l1)])
</code></pre>

python loops for-loop