Balanced brackets: Difference between revisions

Content added Content deleted
m (→‎{{header|Python}}: Formatting)
Line 103:
...
>>> for txt in (gen(N) for N in range(10)):
... print ("%r-22r is%s balanced" % (txt, '' if balanced(txt) else ' not'))
...
'' is balanced
'][]' is not is balanced
'[][]' is balanced
'][[[]]][' is not balanced
'[]][[[][]]' is not balanced
'][][[][]]][' is not balanced
'][[]][][][]][[' is not balanced
'][[]]]]][]][[][[]' is not balanced
'[[[]][]][][]][[][]]' is not is balanced
'[[[][[][[[]]][]]]]][[[[]' is not balanced</lang>
 
=={{header|Tcl}}==