Lesson II : for Loop & IF Statement

In previous lesson, you learned how to make a simple list, and you learned to work with the individual elements in a list. In this lesson, you will learn how to loop through an entire list using just a few lines of code regardless of how long the list is. Looping allows you to take the same action(s) with every item in a list. As a result, you'll be able to work efficiently with lists of any length.

Programming often involves examining a set of conditions and deciding which action to take based on those conditions. Python's if statement allows you to examine the current state of a program and respond appropriately to that state.

In this lesson, you will also learn to write conditional tests, which allow you to check any condition of interest. You'll learn to write simple if statements, and you'll learn how to create a more complex series of if statements to identify when the exact conditions you want are present.