+ 1
Can someone please explain me loops, but also keep it simple?
Where can I use loops and what is "for" doing???
1 ответ
+ 5
There are situations when you want to use a for loop
Situation 1
If you want to do same thing repeatedly
Say output I love Sololearn for three times
The pseudo code will be
For index being 1 to 3
output I love Sololearn
Situation 2 when you need to count things
Say print multiples of 3
Pseudo code
For index being 1 to 3
Output 3*index
Situation 3 when you work on array
Pseudo code
For index being 0 to length of array
Output array[index]