Converting List of String to Integer

ptn tn.pablo at gmail.com
Tue Jul 22 15:27:13 CEST 2008


> n = []
> for k in a:
>     n.append([int(v) for v in k])
> print n
>
> Does anyone know what I am doing wrong?
>
> Thanks in advance.
>
> Samir

Use extend instead of append:

* Append -> add the one item to the end of the list
* Extend -> add the list of items to the end of the list



More information about the Python-list mailing list