Looping Through Nested List - Convert from String to Float
<p>I am new to Python, so apologies if this seems extremely simple:</p>

<p>I have a csv file with 4 columns and a dozen rows. I import the contests as a list (list of lists), and the contents come in as strings. What I want to do is loop through the list (which can be a variable number of rows) and convert the index 2 string to a float. I run the following code, but when i print the list, everything is still a string:</p>

<pre><code>import csv

def main():
    benchmark = list(csv.reader(open('test.csv', 'r')))

    for i in range((len(benchmark))):
        benchmark[i][2] = float(benchmark[i][2])
</code></pre>

<p>Any help would be much appreciated.</p>

<p>Thanks!</p>
