python loops
- From: "Putty" <jaysherby@xxxxxxxxx>
- Date: 31 Aug 2006 11:48:05 -0700
In C and C++ and Java, the 'for' statement is a shortcut to make very
concise loops. In python, 'for' iterates over elements in a sequence.
Is there a way to do this in python that's more concise than 'while'?
C:
for(i=0; i<length; i++)
python:
while i < length:
i += 1
.
- Follow-Ups:
- Re: python loops
- From: Kay Schluehr
- Re: python loops
- From: AlbaClause
- Re: python loops
- Prev by Date: Re: problem with appending to a list, possibly mysqldb related
- Next by Date: Re: Assignment-in-conditional
- Previous by thread: SQLObject or SQLAlchemy?
- Next by thread: Re: python loops
- Index(es):
Relevant Pages
|