title: How to iterate a list from the beginning when it reaches the maximum index
body: <p>Hi i am new in python and i have a problem. I know there is a way to this this with % but i am trying to do it without the modulo if there is a way to do so. I have a list of numbers and i need to every Nth(i have every second number to keep it simple) number to be printed out, but when is reaches the maximux index it will give me an error &quot;list is out of index&quot;. I have tried <code>if original_position &gt;= len(s): for j in s[0:]</code> but it doesnt seems to work. This is what i have come up with so far:</p>
  <pre><code>def napln(n):
  s = []
  for i in range(n):
      s.append(i)
      print(s)
  return s
  
  def rozpocitavadlo(s):
  rozpocitavadlo = []
  for i in s:
      original_position = s[i]
      changed_position = s[i+2]
      original_position = changed_position
      if original_position &gt;= len(s):
          for j in s[0:]:
              original_position = s[j]
              changed_position = s[j+2]
              original_position = changed_position
      rozpocitavadlo.append(s.pop(original_position))
  
  s = napln(6)
  </code></pre>