Re: Combining digit in a list to make an integer

2005-04-01 Thread Facundo Batista
On 1 Apr 2005 03:21:12 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote: > num1 = ['1', '4', '5'] > > How can I combine the elements in num1 to produce an integer 145? >>> num1 = ['1', '4', '5'] >>> int(''.join(num1)) 145 .Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.pyt

Re: Combining digit in a list to make an integer

2005-04-01 Thread Dan Bishop
Harlin Seritt wrote: > If anyone has time, would you mind explaining the code that Dan Bishop > was so kind as to point out to me: > > int(''.join(num1)) > > This worked perfectly for me, however, I'm not sure that I understand > it very well. join(...) S.join(sequence) -> string Return a

Re: Combining digit in a list to make an integer

2005-04-01 Thread Joel
Harlin Seritt wrote: > If anyone has time, would you mind explaining the code that Dan Bishop > was so kind as to point out to me: > > int(''.join(num1)) > > This worked perfectly for me, however, I'm not sure that I understand > it very well. > > Thanks, > > Harlin Seritt ''.join(list of strings

Re: Combining digit in a list to make an integer

2005-04-01 Thread Harlin Seritt
If anyone has time, would you mind explaining the code that Dan Bishop was so kind as to point out to me: int(''.join(num1)) This worked perfectly for me, however, I'm not sure that I understand it very well. Thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Combining digit in a list to make an integer

2005-04-01 Thread Dan Bishop
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)) -- http://mail.python.org/mailman/listinfo/python-list