A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/081177.html below:

break levels

break levels break levelsBenjamin.Altman benjamin.altman at noaa.gov
Mon Apr 16 15:14:02 EDT 2001
Is there a particular reason that Python can't break over multiple
loops?  Example:
    for i in range(0,10):
        for j in range(0,10):
            if some_condition:
                break(2)

which would break out from the inner and outer loop.  This would be
similar to the Bourne shell usage of break.  I suppose you could do a
try and throw an exception instead but it seems that sometimes doing a
break(x) would be convenient.

Ben


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4