Mastery 14 - For
We have already checked one form of using loos. For is another form to use loops in programming but whatโs the difference? For me the best way to understand what a for loop does is to use it with a list. The photo shows the code of one exercise I had to do for a exam (I actually donโt know if itโs okay to post it).
You can see in the comments of the program what does the program does but I will focus in the for loop inside the find_threes function.
The for loop in this case what does is to take every single value in the list and check if the if conditional indented itโs true, if itโs true it will follow with whatever we want to do with this value, but not true it wonโt simply do anything with that value.










