Fruity Loopies

--Originally published at Ricardo's Blog

Getting tired of typing the same commands over and over again?

Getting tired of not being able to do more stuff in less time because of those tedious commands?

Well, I’ve got a solution for you… It’s called Loops.

Loops can help you get rid of all those repeating commands that you type over and over again for numerous times a day. Whether you are drawing with turtles or just wan to get a simple table going, Loops has you covered.

Turtel loop.PNG

And as you can see in the example, it took you 10 commands to make a turtle draw a simple square. But, if you use Loops, as you can see in the last three lines, it only takes about THREE lines to get a square. Pretty cool, right?

VARIABLES LOOP.PNG

Alsoooooooooo, you can ask Python to make a sort of table, if you want. In this first example we wanted to print 3 columns that would count to 9 bit for each column, the result would be a little different. The first column will print the number from 1 to 9, the second column will square the value and then print the result, and finally the third column will cube the value and again print the result.

In the second example we setted 5 columns that will count from 1 to 7, the other columns will print the value times the number of the column that its on.

So I hope I was some great help for youuuuu. Thank you for reading and I hope oyu read my next post.

Bye