<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Il problema è il seguente, io apro un file di testo in cui sono contenuti numeri in virgola mobile (float). Ovviamente nel file questi numeri sono memorizzati come stringhe. Il mio scopo è di convertire ciascuna stringa in un numero float, memorizzandoli in una lista (myList).<br>Ovviamente in questo modo io non ho definito una lista!!!! Ma il problema è proprio questo! Come faccio a tipare myList come una lista lunga quanto numero!?<br><br><font size="2"><span style="font-family: verdana,helvetica,sans-serif;">input_file = open("./mapping.txt","r")</span><br style="font-family: verdana,helvetica,sans-serif;"><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">numero = input_file.readlines()</span><br style="font-family:
 verdana,helvetica,sans-serif;"><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">numero.sort()</span><br style="font-family: verdana,helvetica,sans-serif;"><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">for i in range(len(numero)):</span><br style="font-family: verdana,helvetica,sans-serif;"><span style="font-family: verdana,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; myList = float(numero[i])</span></font><span style="font-weight: bold;"><span style="font-weight: bold;"><br><br><br>Grazie in anticipo e ciao a tutti!!!!<br></span></span></div></div><br>



      <hr size=1><font face="Arial" size="2"><hr size=1><font face="Arial" size="2">L'email della prossima generazione? Puoi averla con la <a href="http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*http://it.docs.yahoo.com/nowyoucan.html">nuova Yahoo! Mail</a></font></body></html>