Counting elements in a list wildcard

hawkesed olaamigoquepasa at hotmail.com
Mon Apr 24 19:33:02 EDT 2006


If I have a list, say of names. And I want to count all the people
named, say, Susie, but I don't care exactly how they spell it (ie,
Susy, Susi, Susie all work.) how would I do this? Set up a regular
expression inside the count? Is there a wildcard variable I can use?
Here is the code for the non-fuzzy way:
lstNames.count("Susie")
Any ideas? Is this something you wouldn't expect count to do?
Thanks y'all from a newbie.
Ed




More information about the Python-list mailing list