In this bit of code, is there a way to do away with the "count" var?
Code:
count = 0
for root,dirs,files in os.walk("/some/dir"):
count += 1
if (count % 10 == 0):
do_something()
I think I remembered seeing some special built-in that you can ask which index of the iteration you're on rather than maintaining a "count" variable. Is that correct?