Ola Fosheim Grøstad:

[0.1*x for x in range(10)]

map(operator.mul,range(10),[0.1]*10)

numpy.arange(0.,0.95,0.1)

numpy.linspace(0,0.9,num=10)

list(itertools.islice(itertools.count(0.0, 0.1), 10))

The first one (the list comp) is Pythonic, and it's obviously the obvious one :-)

If you want/need to use numpy, the fourth is good.

No problems :-)

Bye,
bearophile

Reply via email to