[CentralOH] Balanced Parentheses

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Mon Nov 17 19:54:04 CET 2014


On Mon, 17 Nov 2014 23:30:44 +0800, iynaix <iynaix at gmail.com> wrote:

> Is the example of the balancing parens an academic exercise? 

Yes, very much so, for thought, practice, and discussion about 
making good code in both little and big ways. 

Little things are important because bad code is often death by a 
thousand cuts, not just one big bad thing.

--------------------------------------------------------------------------------

>     print(repr(s), s.count('(') == s.count(')'))

That reminds me that I should have supplied the test code also 
so that you knew what the expected results and implied fuller 
definition of the task were. I do so now in the attachments. 
The tests passed in the style of
https://github.com/james-prior/tdd-demo/blob/master/README.md
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: balance_parens.py
URL: <http://mail.python.org/pipermail/centraloh/attachments/20141117/85f51937/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_parens_are_balanced.py
URL: <http://mail.python.org/pipermail/centraloh/attachments/20141117/85f51937/attachment-0001.ksh>


More information about the CentralOH mailing list