Using wild character
Diez B. Roggisch
deets at nospam.web.de
Thu Sep 6 09:21:08 CEST 2007
> I am a beginner in Python. I wish to know how can i filter a list of
> strings using wild characters.ie
> Lets say i have list countries =
> ["india","africa","atlanta","artica","nigeria"]. I need only the list
> of string starting with 'a'.
While the startswith-method others pointed out works, I wanted to direct
you attention to the module fnmatch.
It will work with real wildcards.
More information about the Python-list