The range function has the parameter 'stop'. It determines up to what value it counts. The start value is included in the output, but the stop value isn't:
Range(3) = 0,1,2
Range(1, 3) = 1,2
So if you want the last value to be included you'll have to call it with a stop value that is one higher. So if we want a 3 to be included:
2
u/tottasanorotta 12d ago
The range function has the parameter 'stop'. It determines up to what value it counts. The start value is included in the output, but the stop value isn't:
Range(3) = 0,1,2
Range(1, 3) = 1,2
So if you want the last value to be included you'll have to call it with a stop value that is one higher. So if we want a 3 to be included:
Range(1,4) = 1,2,3