I'm trying to iterate through a list using a for loop (the index starts at 0) and I want a certain function to execute every 10th index. However, since I'm grouping the numbers in the list by 10 in that function (for example, 0-9,10-19,20-29 and so on), index%10 doesn't work. Is there a more efficient way of doing this? The code I have below works, but I feel like there is a better way to do it?
if(index>1 and index<10):
if((index)%9 == 0):
func()
elif(index>10):
if((index+1)%10 == 0):
func()