I want to read an input file (file.csv) that has two columns. I want to read 2nd column and assign variables that are strings and floats. Currently, I use the following split() function to read from the input file and create a list, and then assign each element to a variable. <br><br>I am wondering there is any other easier (and elegant) way of doing this ?<br><br>data = []<br>for line in open("file.csv"):<br>&nbsp;&nbsp;&nbsp;&nbsp; columns = line.split(',')<br>&nbsp;&nbsp;&nbsp;&nbsp; data.append([columns[1]])<br><br>This script returns, say:<br>data = [ ['20.0'], ['0.34'], ................,[ 'a:0.20, b:0.30, c:0.50' ]]<br><br>Then, I assign to a set of variables, say:<br><br>x1 = float(data[0][0]) ; x2 = float(data[1][0]);.............;xn = data[-1][0] <br><br><br>Thanks,<br>Lex<br><br><br><br><br><br><br><p>&#32;



      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>