Jimbo ha scritto:
HelloI am trying to find if there is a string OR list function that will search a list of strings for all the strings that start with 'a' & return a new list containing all the strings that started with 'a'. I have had a search of Python site & I could not find what I am looking for, does a function like this exist?
>>> sw = lambda s: lambda t: t.startswith(s)>>> list = ["a string","another one","this is a string","and so is this one"]
>>> filter(sw("a"),list)
['a string', 'another one', 'and so is this one']
>>>
bye
--
http://mail.python.org/mailman/listinfo/python-list
