Input:-
for i in range(0,5):
print (i)
i=i+2
else:
print ('none')
output:-
0
1
2
3
4
none
Normally by giving this input, i thought that the output must be something like this:-
0 2 4 none
But instead it also shows numbers 1 and 3. why is it so? why does the loop doesn't stop when it encounters as i=6 and why does it goes again to find new numbers in the range.
I tried asking chatgpt 3.5 and bing ai but none of them were of any help.