[EMAIL PROTECTED] wrote:

 > The dict solution looks better, but this may be faster:

it's slightly faster, but both your alternatives are about 10x slower 
than a straightforward:

def balanced(txt):
     return txt.count("(") == txt.count(")")

</F>

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

Reply via email to