I want to loop over list with indexes, while looping I want for loop to consider both start index and last index, although it respect start index it does not respect last index. The code I am trying is this:
arr = [0,1,2,3,4,5,6,7,8,9]
for i in arr[4:8]:
print(i)
Actual Result:
4
5
6
7
Desired Result:
4
5
6
7
8