Introducing loops - For
Introducing loops - While
Set your Learning Objectives to red.
We are going to save all of our work for this topic into this PowerPoint.
Save your PowerPoint as 'Programming 1'
While we can use a While loop as a counting loop we tend to use a for loop for that, so why do we need a while loop>
A while loop is generally used for two thing.
We are now going to create a simple while loop that repeats until the user answers 'yes' and then prints out 'thank you' when it leaves the while loop.
Save the file name as while_loop.
Run the code.
In your Powerpoint put a screenshot of your code.
We are now going to use a while loopto see if the user can guess a number between 1 and 10.
Lets make an algorithm to solve this problem
Look at the example code below to see how you can use a while loop to improve your game
Lets look at the learning outcomes and decide which one best describes our current level of understanding :
Tick the one you feel is closest to your level