This week we will focus on making decisions and repeating tasks in Python. Both of these concepts are part of the larger computing idea called control flow, which refers to how the execution of different parts of a computer program is determined. We will learn how to alter the execution of our scripts are using (1) loops, which are used to repeat execution of parts of a program, and (2) conditional statements, which use basic logical tests to determine which parts of a program will be run.
After this weeks lesson your should be able to:
- Create a
forloop and use it to repeat a section of code
elsestatements to make decisions in your programs
- Explain how values can be compared using comparison operators