The third way of writing loops is repeat loops. It is identical to a while loop, but the condition is checked at the end of the code block. If we use the same example from before, we can write:
var myNum =1repeat{ //code blockprint(myNum) myNum +=1}while myNum <=50
The point is repeat loops will execute the code block at least once. So, you should be careful about the cases where the first iteration may result in errors.