BS Loops

Learn how BornomalaScript repeats actions using for, jokhon (while), and do-while loops.

Loops

Loops let your program repeat the same action more than once.

They are useful when you want to print a series of values, walk through a list, or keep running code until a condition changes.

Why Loops Matter

Without loops, you would need to write the same code again and again.

Loops help you:

  • repeat actions efficiently
  • reduce duplicate code
  • process lists and counters
  • build interactive programs

What You Will Learn

In this section, you will learn three common loop styles:

  • For Loop
  • While Loop
  • Do While Loop

Each lesson explains when to use that loop and how it behaves.

Learning Path

Start with the for loop, then move to while, and finish with do-while.

Quick Preview

  • A for loop is best when you know how many times you want to repeat
  • A while loop is best when the repetition depends on a condition
  • A do-while loop runs once first and then checks the condition

Practice Tip

Try changing the loop limits in each lesson so you can see how the output changes.