Little novice program written in Python

Rogério Brito rbrito at ime.usp.br
Mon Apr 28 16:44:41 EDT 2008


On 04/25/2008 01:09 AM, Dennis Lee Bieber wrote:
> On Thu, 24 Apr 2008 21:31:15 -0300, Rogério Brito <rbrito at ime.usp.br>
> 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-comp in that era... range() also begins with 0

Thanks for the suggestion. As I stated in my original message, I'm only 
"side-learning" Python, and I naturally think in list-comprehensions (it is like 
a set in Mathematics and you've seen that my program is Mathematical in its nature).

This is exactly the kind of suggestion that I was looking for.


Thanks, Rogério.

-- 
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