And that's 6996 lines of code that you did not have to type.
Next try to apply it to code that you've already written that you think had things that were somewhat repetitive. The variable i is called a sentry variable and when it reaches the condition that we put in the while() argument, it will break the loop and the program continues from where it exits.
Really just start using loops in small ways and you'll pick it up pretty quickly from there.
There are a couple of loop types, but get comfortable with while() before moving on to the others.