Using wild character

Diez B. Roggisch deets at
Thu Sep 6 09:21:08 CEST 2007

Sreeraj schrieb:
> hi,
>  I am a beginner in Python. I wish to know how can i filter a list of
> strings using wild
> 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 mailing list