In the previous post in this series we looked at if statements in Python. We saw how to set up conditions and tweak our actions accordingly. An if-block is only carried out if the boolean expression results in true.
However, what if we want to carry out an action as long as some condition is true and stop as soon as the condition is false? Consider the following sentences:
If the weather is nice then we’ll play football.
While the weather is nice we’ll be playing football.
View original post 288 more words