Author rhettinger
Recipients docs@python, larry, prasechen, rhettinger, steven.daprano, terry.reedy
Date 2020-09-05.01:17:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599268642.76.0.815708228036.issue41719@roundup.psfhosted.org>
In-reply-to
Content
FWIW, the usual approach to the OP's problem is:

    >>> [x*0.5 for x in range(10)]
    [0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5]

This technique generalizes to other sequences as well:

    >>> [x**2 for x in range(10)]
    [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

As Steven points out, numeric work typically requires something different and a bit more sophisticated.  The numpy package may be your best bet for this kind of work.
History
Date User Action Args
2020-09-05 01:17:22rhettingersetrecipients: + rhettinger, terry.reedy, larry, steven.daprano, docs@python, prasechen
2020-09-05 01:17:22rhettingersetmessageid: <1599268642.76.0.815708228036.issue41719@roundup.psfhosted.org>
2020-09-05 01:17:22rhettingerlinkissue41719 messages
2020-09-05 01:17:22rhettingercreate