A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-March/052305.html below:

[Python-Dev] Python 2.4 | 7.3 The for statement

[Python-Dev] Python 2.4 | 7.3 The for statementNick Coghlan ncoghlan at iinet.net.au
Sun Mar 20 03:46:32 CET 2005
Juan Carlos Rodrigo Garcia wrote:
> It is easier if we see it beforehand:
> -------------------------------------
>  
> leave = False
> alist = [1,2,3,3,4,5,6,7,8,9]
> for item in alist and not leave:
>  if item is 1: leave = True

Interesting idea, but not really needed given the existence of the break statement:

for item in alist:
   if item is 1:
     break

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net
More information about the Python-Dev 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