r/PythonLearning • • 4d ago

i am stuck with the range function

sorry but i am gonna crash out because of the range function i cant understand it well to use it this is driving me crazy any one could give me a video explaining everything i dont mind it being an hour long

8 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/mountain-snowman 3d ago

I think what you want is:

Ni_arrow = [sum(Ni[:i+1]) for i in range(len(Ni))]

This is a test code and there are better ways to do it while using the range as shown.