SETSWANA TRANSLATION: Skip to content

gopheta

SETSWANA TRANSLATION: Repeats a block of code a specific number of times.

SETSWANA TRANSLATION: Use gopheta when you know how many times you want to repeat something. The loop has three parts: an initializer, a condition, and an update step.

SETSWANA TRANSLATION: gopheta (init; seemo; tswelopele) { ... }
SETSWANA TRANSLATION: Print numbers 0 to 4
gopheta (diri i = 0; i < 5; i = i + 1) {
  kwala(i);
}

nako