Re: Dumm python question

2004-08-10 Thread Angus Leeming
Jose' Matos wrote: > On Tuesday 10 August 2004 12:23, Angus Leeming wrote: >> Ok, Jose. The ignorant one strikes again. >> >> How do I initialise a list of 25 items to 0? >> In C++ >> std::vector path_bins(25, 0); >> >> In python, I've got: >> >> path_bins = [] >> for i in range(0,

Re: Dumm python question

2004-08-10 Thread Stefaan
In python, I've got: path_bins = [] for i in range(0, 25): path_bins.append(0) path_bins = [0]*25

Re: Dumm python question

2004-08-10 Thread Jose' Matos
On Tuesday 10 August 2004 12:23, Angus Leeming wrote: > Ok, Jose. The ignorant one strikes again. > > How do I initialise a list of 25 items to 0? > In C++ > std::vector path_bins(25, 0); > > In python, I've got: > > path_bins = [] > for i in range(0, 25): > path_bins.append

Dumm python question

2004-08-10 Thread Angus Leeming
Ok, Jose. The ignorant one strikes again. How do I initialise a list of 25 items to 0? In C++ std::vector path_bins(25, 0); In python, I've got: path_bins = [] for i in range(0, 25): path_bins.append(0) which feels 'sub-optimal' ;-) -- Angus