Combining digit in a list to make an integer

Dan Bishop danb_83 at yahoo.com
Fri Apr 1 06:30:49 EST 2005


Harlin Seritt wrote:
> I have the following:
>
> num1 = ['1', '4', '5']
>
> How can I combine the elements in num1 to produce an integer 145?


int(''.join(num1))




More information about the Python-list mailing list