>GOCO IDE
  • Home
  • Docs
Download
Documentation
Documentation
01Chapter 1: Basics02Chapter 2: Variables & Types03Chapter 3: Input and Output04Chapter 4: Math and Operators05Chapter 5: Making Decisions06Chapter 6: Repeating Parts (Loops)07Chapter 7: Functions08Chapter 8: Arrays (Lists)09Chapter 9: Standard Libraries
Docs6. Loops: Doing Things Over and Over

6. Loops: Doing Things Over and Over

Learn Loops: Doing Things Over and Over through beginner-friendly explanations, working GOCO examples, and their expected output.

6.1 Basic Loop

Loops are a great way to repeat yourself without writing the same line twice. A simple Loop will keep going as long as its rule is True.

goco
Number count = 0.
Loop (count < 3) {
Displaynl(count).
count = count + 1.
}

6.2 The Till Loop

You can write all loop instructions in a single line using Till. You give it a start, a rule to end, and a way to climb up.

goco
Loop (Number step = 0 Till step < 3, step++) {
Displaynl("Walking step: " + step).
}

6.3 Stopping Early

You can jump out of a loop at any time using Break. If you want to skip the current step but keep looping, use Continue.

goco
Loop (Number i = 1 Till i < 5, i++) {
If (i == 2) {
Continue.
}
If (i == 4) {
Break.
}
Displaynl(i).
}
Previous5. If Statements and Choices
Next7. Reusable Code with Functions
GGOCO IDE

Write real code, compete in ranked battles, and level up your problem solving in one editor.

Stay updated

Get product updates and new learning resources. No spam.

Product

  • Home
  • Docs
  • Download IDE

Account

  • Sign in
  • Create account
  • Add a review
  • Send a suggestion

Contact

+91 93269 63378kancorp.inc@outlook.com
KanCorp Inc, India
© 2026GOCO IDE™. All rights reserved.Made withby KANCorp Inc.