⌨️ap computer science principles review

While loop

Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examWritten by the Fiveable Content Team • Last updated September 2025

Definition

A while loop is a type of conditional looping structure that repeatedly executes a block of code as long as its specified condition remains true. It checks the condition before executing the code block.

Pep mascot

"While loop" also found in: