newbie.string.listless

Tyler Eaves tyler at tylereaves.com
Fri Aug 31 23:39:59 EDT 2001


FMH wrote:

> Hi
> Trying to  to process a  list and use a string function on each item in
> the
> list, then return a new list with the Capitalized items.  The output is
> correct but how do you capture it to a  new list.  I realize you can't use
> a string function on a list but by making a list copy and iterating over
> the items shouldn't this work.

Well, there is the hacky and ugly way :)

list1=['foo','bar']
list2=[]
for x in list1[:]:
        list2.append(string.dosomething(x))







More information about the Python-list mailing list