title: How do I create a rollover counter within a list in Python?
body: <p>I need to build a rollover counter within a list in python. Given a starting list of a variable length startlist, and all terms minnum, the counter should increment index 0 by one until it reaches maxnum, at which point index 0 resets to minnum and index one increments by one. This continues until all terms of the list are maxnum, at which point the loop should end. Here is an example.
  <code>minnum = 1, maxnum = 2, startlist = [1, 1, 1]</code> The counting begins. <code>[1, 1, 1] -&gt; [2, 1, 1] -&gt; [1, 2, 1] -&gt; [2, 2, 1] -&gt; [1, 1, 2] -&gt; [2, 1, 2] -&gt; [1, 2, 2] -&gt; [2, 2, 2] -&gt; end</code></p>
  
  <p>I have tried a lot of code but nothing seems to work. If someone could please help me out with this that would be much appreciated.</p>