I understand that the following line will give the given result:
for in range(5):
print(i)
0 1 2 3 4
But I don\'t understand how
for i in range(4, 10, 2):
print(i)
in the above code, range has 3 parameters :
For more clarity refer below for the java representation of above python code:
for (int i=0; i<10; i+=2){ System.out.println(i) }
range(start_pos, end_pos, increment)
Starts at 4, then increments by 2, to end at 8 because 10 < 10
is false. So 4 6 8