[Tutor] casting string to integer in a list of lists

Kent Johnson kent37 at tds.net
Fri Jan 9 17:57:19 CET 2009


On Fri, Jan 9, 2009 at 11:23 AM, culpritNr1 <ig2ar-saf1 at yahoo.co.uk> wrote:
> That is EXACTLY what I was looking for.
>
> Actually, int() does not really work but this does:
>
> [ [line[0], eval(line[1]), eval(line[2])] + line[3:] for line in LoL]

That's strange. What happened when you tried int() ? What version of
Python are you using?

Kent

PS Please subscribe to the list


More information about the Tutor mailing list