Right now in Computer Science/ Coding we are learning about a very powerful tool – loops. Loops describe when we repeat an action for every item in a group or while a certain condition is true. Thus, we have two types of loops when programming with Python – for loops and while loops.
It can be helpful to think of loops in our everyday lives. Take icing cupcakes, for example. You bake 24 cupcakes and put icing on one cupcake at a time until you have iced all 24 cupcakes. Or you add pictures to Facebook and go through each one tagging your friends’ and family members’ faces until you get through all of the pictures. Both of these are examples of for loops. For each item in the group (cupcakes, pictures, etc.), something happens to the item (the cupcake gets iced, the picture gets tagged, etc.)
While loops are a little different…
Read More