If range(0, 3)
returns the sequence 0, 1, 2
then why can't I simply print this sequence using the following code:
x = range (0, 3)
print(x)
Why do I need to use a for loop
to do so?
x = range (0, 3)
for i in x:
print(i)
How do I understand how the range
function generates the sequence and stores it, making a iterating function necessary to access all the numbers in the sequence.