On Wed, Nov 29, 2006 at 10:03:31AM +0100, Alessandro Pisa wrote:
>On Wednesday 29 November 2006 08:49, Tollardo, Mauro wrote:
>> i cui elementi NON sono degli interi come posso con un solo comando
>> ottenere un vettore di interi: [200,300,12] senza dover ricorrere
>> ad un ciclo for e alla sintassi int(list[i]) ? 
>> Grazie mille.
>> Mauro
>
>[int(x) for x in list]
>
>Questa era facile ;)

li = ['200', '300', '12']
map(int, li)

evvai con le varianti ;)

-- 
reply to `python -c "print '[EMAIL PROTECTED]'[::-1]"`

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a