Little novice program written in Python

Rogério Brito rbrito at ime.usp.br
Mon Apr 28 22:56:36 CEST 2008


On 04/25/2008 05:00 AM, John Machin wrote:
> On Apr 25, 5:44 pm, Robert Bossy <Robert.Bo... at jouy.inra.fr> wrote:
>> If the OP insists in not examining a[0] and a[1], this will do exactly
>> the same as the while version:
>>
>> for p in a[2:]:
>>     if p:
>>         print p
> 
> ... at the cost of almost doubling the amount of memory required.

Yes, despite the asymptotic consumption of memory being the same, the practical 
one is also a concern. And in my original version of that loop (sketched in 
paper) was a for loop, but with C syntax.

-- 
Rogério Brito : rbrito@{mackenzie,ime.usp}.br : GPG key 1024D/7C2CAEB8
http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito
Projects: algorithms.berlios.de : lame.sf.net : vrms.alioth.debian.org



More information about the Python-list mailing list