python - Do something every n iterations without using counter variable -


I have a recurring list of more than 100 elements I want to do after every 10th iterative element. I do not want to use a counter variable. I'm looking for some solution that does not contain any counter variable.

Currently I do this:

  for category i = 0 (0, mylist)): if count == 10: count = 0 # some Print I count + = 1  

Is there a way in which I can leave the counter variable?

  for  element (my list, 1) 1 if the calculation% 10 == 0: # do something  

use it for its creation


Comments