How to loop through the index of a list in python?
<p>I'm trying to write to a file, with the first line being [0] in the list, 2nd line being [1], etc.</p>

<p>Here's a quick example</p>

<pre><code>crimefile = open('C:\states.csv', 'r')
b = crimefile.read()
l = b.splitlines()
print l[1]

states = open('c:\states.txt', 'w')
states.write('"abc"' + " " + '%s' '\n' %l[0+=])

states.close()
</code></pre>

<p>I'm really new to loops in Python and I am not too sure about loops and how to increase integers during loops, basically.</p>
