[Tutor] Converting a string to a list with each character as an item

2007-01-11 Thread Amadeo Bellotti

does anyone know how to do this? I need it because i want to make a binary
coverter
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Converting a string to a list with each character as an item

2007-01-11 Thread Terry Carroll
On Thu, 11 Jan 2007, Amadeo Bellotti wrote:

 does anyone know how to do this? I need it because i want to make a binary
 coverter

 s = 101001100100101
 l = list(s)
 l
['1', '0', '1', '0', '0', '1', '1', '0', '0', '1', '0', '0', '1', '0', '1']

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Converting a string to a list with each character as an item

2007-01-11 Thread Danny Yoo


On Thu, 11 Jan 2007, Terry Carroll wrote:

 On Thu, 11 Jan 2007, Amadeo Bellotti wrote:

 does anyone know how to do this? I need it because i want to make a binary
 coverter

 s = 101001100100101
 l = list(s)
 l
 ['1', '0', '1', '0', '0', '1', '1', '0', '0', '1', '0', '0', '1', '0', '1']

By the way Amadeo, is it really necessary to do the conversion here? 
Strings follow the same indexing as lists, and they can also be used in 
loops.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Converting a string to a list with each character as an item

2007-01-11 Thread Bob Gailer
Amadeo Bellotti wrote:
 does anyone know how to do this? I need it because i want to make a 
 binary coverter
  list('abc')
['a', 'b', 'c']

-- 
Bob Gailer
510-978-4454

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor