While you were sleeping

--Originally published at Codebuster

Repetitions are a very important part of any programmers life. It is one of those cheat things you can do when you need to repeat an action, instead of writing the condition over and over again.

One of this loops is “while”. It is my personal favorite because you can use it in various forms. You use the while loop mainly when you want a condition to be reviewed until it becomes true, but (and here is the deal) you don’t really know how many times it will be repeated.

Using while loops is very simple, all you have to do is write “while” and then write the conditions.

x=15

while x<100:

print (x)

x+=5

You can click the image below to see a tutorial for while loops:

while.gif