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/TJATAW 4d ago

The only way I am seeing range being useful in that would be range(len(Ni)).

range used that way would make it work for any length of Ni.

One more hint:

fruits = ["apple", "banana", "cherry", "date"]

print(fruits[0]) # Output: "apple"
print(fruits[2]) # Output: "cherry"