I am out of trial and error again Lists

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Oct 24 04:12:28 EDT 2014


On 24/10/2014 08:05, Mark Lawrence wrote:
> On 22/10/2014 21:30, Seymore4Head wrote:
>> def nametonumber(name):
>>      lst=[""]
>>      for x,y in enumerate (name):
>>          lst=lst.append(y)
>>      print (lst)
>>      return (lst)
>> a=["1-800-getcharter"]
>> print (nametonumber(a))#18004382427837
>>
>>
>> The syntax for when to use a () and when to use [] still throws me a
>> curve.
>>
>> For now, I am trying to end up with a list that has each character in
>> "a" as a single item.
>>
>> I get:
>> None
>> None
>>
>
> Following on from the numerous responses you've had here, I've no idea
> if this helps your thought processes but there's only one way for you to
> find out http://www.greenteapress.com/thinkpython/ :)
>

And another http://tinyurl.com/k26vjhr

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list