I need to increment a variable each time a certain number of calls to a certain function is made in Python 2.7.3.
For example, feetTraveled = 0. for every 12 calls to travelOneInch(), feetTraveled += 1.
Is it optimal to use a for loop or should I be using something different? If it is optimal to use a for loop like the one above, what should be placed instead of 'every 12 calls to'?
Another example: I have four servants. They each do one task in a clock tick, and the time counter is initially time = 0. So for every four calls to servantDo(), time += 1.