Python Tutorials – Making Decisions by Using Conditional Statements
Real life problems, however, often require our programs to act as decision makers: to examine a property of some bit of data and decide what to do with it. In this chapter, we’ll see how to do that using conditional statements. Conditional statements are features of Python that allow us to build decision points in our code. They allow our programs to decide which out of a number of possible courses of action to take – instructions like “print the name of the sequence if it’s longer than 300 bases” or “group two samples together if they were collected less than 10 metres apart”.