While Loops
A while loop keeps running a block of code as long as its condition is true. Be careful not to create infinite loops!
Basic While Loop
You must ensure the condition eventually becomes false, usually by updating a variable inside the loop.
Do...While Loop
A do...while loop guarantees the code runs at least once, because the condition is checked after the loop runs.
Practice
Challenge 1: Write a while loop that doubles a number starting from 1 until it's greater than 100.