On Sat, 08 Oct 2005 13:19:48 +1000, Steven D'Aprano wrote:

> 
> def count_matches(s, words):
>     temp = [word.lower().startswith(s) for word in words]
>     return len(temp)


Oops! A *serious* bug in that code :-(

Replace "return len(temp)" with "return len(filter(None, temp))".

-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to