Lesson 5

This is Python Lesson 5

Now last lesson we learnt a simple loop, I hope you’ve now got a lot of knowledge about simple loops because in this lesson we are moving on to while loops. What is a while loop? Well a while loop is a loop that only runs while a certain statement is true. While the certain statement is true it will keep on running continuously, but when the statement becomes false it will stop. Now if we wanted to make a loop that never stopped we would choose a statement that would never change:

The code above will forever (it may glitch out online) continuously print the words Python Star in the Python shell. You can try printing variables in loops. Now you can add multiple variables and loops and have an experiment, what will you create?