LESSON 11: Personal Protection and Data Protection

LEESON 10.3: Loops

Today we learn about the concept of loops in programming. Loops in programming are used to make the program repeat the code several times.

This term is very simple to teach children since it is as easy as performing any activity and making them see how with repetition they can achieve a systematized action.

Tutorial: «Loops» en Scratch


LOOPS IN SCRATCH

In Scratch, loops are represented by the block "repeat". We can use this block and fill it with different blocks so it repeats an action the number of times we want it to.

At first "i=0" which is a variable that is going to change during the code.We have choose the limit in "i<=3", so while "i" is lesser that 3 or equal the "i" is going to increase until 3 with "i++".
Finally when "i" arrived to 4 because is greater than 3 the code goes to the end because is over the limit we have set at the beggining. After that we worked with scratch and we did several exercises that runs in a similar way that the primary code . We used the tool of "control" which say " repeat until".


A similar example that we did in scratch: 






Comments