Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
range has nothing to do with for. The for statement is for looping, while the range function returns a sequence.
For example, range(5) will return the list [0, 1, 2, 3, 4].
This list can be traversed with for.
for num in range(5):
print(num)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question