Jun-20-2019, 09:05 AM
(This post was last modified: Jun-20-2019, 09:05 AM by noisefloor.)
Hi,
Except this, iteration by
And your variable names are pretty weird... why do you have at nearly all variables the letter a post-fixed?
Regards, noisefloor
Quote:which sums elements of the list (from current index to the last)Your current code doesn't reflect that, as you always start at the 1st element?
Quote: and inserts its result to the appropriate cell on the new list.What does that means exactly? Does mean if your input list is
[1, 2, 3, 4]
, the result list is supposed to be [3, 6, 10]
?Except this, iteration by
for i in range(len(iterable))
combined with accessing elements of iterable by index is an bad anti-pattern in Python. Python supports direct iteration of iterables.And your variable names are pretty weird... why do you have at nearly all variables the letter a post-fixed?
Regards, noisefloor