Converting List of String to Integer

ptn tn.pablo at gmail.com
Tue Jul 22 09:27:13 EDT 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