PYTHON LESSON 3: Conditionals & Control Flow

## **Go with the Flow;**

Just like in real life, sometimes we’d like our code to be able to make decisions.

The Python programs we’ve written so far have had one-track minds: they can add two numbers or print something, but they don’t have the ability to pick one of these outcomes over the other.

Control flow gives us this ability to choose among outcomes based on what else is happening in the program.

\
For Example;

| `def clinic():` \n ` print "You've just entered the clinic!"` \n ` print "Do you take the door on the left or the right?"` \n ` answer = raw_input("Type left or right and hit 'Enter'.").lower()` \n ` if answer == "left" or answer == "l":` \n ` print "This is the Verbal Abuse Room, you heap of parrot droppings!"` \n ` elif answer == "right" or answer == "r":` \n ` print "Of course this is the Argument Room, I've told you that already!"` \n ` else:` \n ` print "You didn't pick left or right! Try again."` \n ` clinic()` \n \n `clinic()` |
|----|

## **Compare Closely;**

Let’s start with the simplest aspect of control flow: comparators. There are six:

\
Equal to (==)

| `>>>2 == 2` \n `True` \n `>>>2 == 5` \n `False` |
|----|

Not equal to (!=)

| `>>>2 != 5` \n `True` \n `>>>2 != 2` \n `False` |
|----|

Less than (
robot