Little novice program written in Python

2008-04-24 Thread Rogério Brito
print a[i] i += 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Thank you for any help in improving this program, -- Rogério Brito : [EMAIL PROTECTED],ime.usp}.br : GPG key 1024D/7C2CAEB8 http://www.ime.usp.br/~rbrito : http://meusite.mackenzie.com.br/rbrito Projects: algorith

Re: Little novice program written in Python

2008-04-28 Thread Rogério Brito
On 04/25/2008 01:09 AM, Dennis Lee Bieber wrote: On Thu, 24 Apr 2008 21:31:15 -0300, Rogério Brito <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: a = [i for i in range(0,n+1)] Uhm... At least in 2.4 and earlier, range() returns a list... No need for the list-c

Re: Little novice program written in Python

2008-04-28 Thread Rogério Brito
On 04/25/2008 01:30 AM, Steve Holden wrote: Rogério Brito wrote: I'm just getting my feet wet on Python and, just for starters, I'm coding some elementary number theory algorithms (yes, I know that most of them are already implemented as modules, but this is an exercise in le

Re: Little novice program written in Python

2008-04-28 Thread Rogério Brito
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 : [EMAIL PROTECTED],ime.usp}.br : GPG key 1024D/7C

Re: Little novice program written in Python

2008-04-28 Thread Rogério Brito
On 04/25/2008 09:30 AM, Nick Craig-Wood wrote: When you are up to speed in python I suggest you check out gmpy for number theory algorithms. Thanks. That is quite useful to know when I don't want to code explicitly the details of the algorithm. Thanks, Rogério. -- Rogério Brito : [

Many newbie questions regarding python

2010-10-07 Thread Rogério Brito
nd this or is that simply "a matter of life"? I have some other questions, but I will save them for latter. Please, keep in mind that I am a newbie in Python. Despite that, I am enjoying the little that I know. Thank you very much in advance, -- Rogério Brito : rbr...@{ime.usp.br,gm