Python - Repeat counter when index ends : Simple question - i want a loop that counts up and returns to 0 when it reaches a certain number.

tried something like

            while i < 7:
                  i += 1
                  if i == 7
                     i -= 1   #(or change i in any other way - you get the idea)

My Python actually crashed when i tried the above.