Harlin Seritt wrote:
Roy, I like what you showed: nums = [a for a in range(100)] . My
mistake for not expressing my question as well as I should have. Not
only am I looking for a way to fill in 100 spots (more or less) in an
array er... list, but I'd like to be able to do it in intervals of
2,
Will McGugan wrote:
Warren Postma wrote:
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program
I was working on could be expressed in three lines of python. Ahh.
Lately I've found myself commenting C++ code
Warren Postma wrote:
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program I
was working on could be expressed in three lines of python. Ahh.
Lately I've found myself commenting C++ code with the equivalent P
Harlin Seritt wrote:
Roy, I like what you showed: nums = [a for a in range(100)] . My
mistake for not expressing my question as well as I should have. Not
only am I looking for a way to fill in 100 spots (more or less) in an
array er... list, but I'd like to be able to do it in intervals of
2,
Excellent point Warren. I have been working with Python for about 3
years in all, but only really seriously for about a year. I am still
utterly amazed that near everything that takes me about 5 to 20 lines
of code can be done in 1, 2 or 3 lines of Python code (when done
correctly). It is very frus
Will McGugan wrote:
Isn't that equivalent to simply..
nums= range(100)
I remember the day I first realized that 900 lines of some C++ program I
was working on could be expressed in three lines of python. Ahh.
Rebirth. Then there was the phase of the python-newbie so enamored of
map and lambda.
Harlin Seritt <[EMAIL PROTECTED]> wrote:
>I've got the following code:
>
>nums = range(0)
>for a in range(100):
> nums.append(a)
>
>Is there a better way to have num initialized to a list of 100
>consecutive int values?
Step one would be to change the first line to
nums = []
which is simpler a
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
You mean like this?
nums = range(100)
;-)
--
--
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
Why not the simplest solution?
a = range(100)
regards
Steve
--
http://mail.python.org/mailman/listinfo/p
Harlin Seritt wrote:
I've got the following code:
nums = range(0)
for a in range(100):
nums.append(a)
Is there a better way to have num initialized to a list of 100
consecutive int values?
Isn't that equivalent to simply..
nums= range(100)
Will McGugan
--
http://mail.python.org/mailman/listinfo/
10 matches
Mail list logo