Page 63 - ThinkGPT_V2.1_C3_Flipbook
P. 63
Loops
The act of repeating an action again and again is called looping.
Let us understand loops with the help of an example.
You can observe that first Herry goes up towards the sky.
In the second round, Herry and Jerry are both at the same level.
In the third round, Jerry is at a higher level. Thus, the cycle
goes on.
Repeating a set of steps is a loop.
Understanding Programs
A computer understands step-by-step instructions written only in a unique language, known
as program. The computer reads the program we write and follows as per our instructions.
Let us write a program to make a square.
Move 2 steps right.
Move 2 steps up.
Move 2 steps left.
Move 2 steps down.
Start
Similarly, we can write a program to make a rectangle.
Move 2 steps right.
Move 1 step up.
Move 2 steps left.
Move 1 step down.
Start
Stepwise Thinking 61

