Ch.13 Computational Thinking and Programming Basics Vocabulary 220 words

Loop: repeat until done

A loop repeats steps until a condition is met or a sequence is complete; the exam trap is confusing it with a conditional (if-then).

Аудио

Слушай тази страница (бета)

Субтитри

A loop is a programming structure that executes a block of code repeatedly until a specified condition becomes false or a sequence of items is exhausted. The key contrast with a conditional (if-then) is that a conditional runs its block at most once, whereas a loop runs its block zero or more times. For example, checking each email in an inbox uses a loop; deciding whether to reply to a single email uses a conditional.

To spot a loop in exam questions, look for phrases like "repeat until," "for each," or "while." A common trick is that a loop's condition is evaluated before each iteration (for while loops) or after each iteration (for do-while loops). If a question describes a process that must happen multiple times based on a changing value, it is a loop, not a conditional. Also, remember that an infinite loop occurs if the condition never becomes false, which is a frequent trap in debugging scenarios.

A compact way to test your understanding: ask yourself, "Does this step need to happen more than once based on a condition or a list?" If yes, it is a loop. For memory, think of a loop as a "repeat until done" sign: you keep going until the stop condition is met, just like a countdown timer that ticks until zero.

Свързана флашкарта

What is a loop?

A structure that repeats steps until a condition is met or a sequence is complete.

Обратно към флашкартата Виж всички флашкарти