  So far, we have presented a Boolean option for conditional statements, with each if statement evaluating to either true or false. In many cases, we will want a program that evaluates more than two possible outcomes. For this, we will use an else if statement, which is written in Python as elif. The elif or else if statement looks like the if statement and will evaluate another condition.

In the bank account program, we may want to have three discrete outputs for three different situations:

• The balance is below 0
• The balance is equal to 0
• The balance is above 0
The elif statement will be placed between the if statement and the else statement as follows:

```balance = 522

if balance < 0:
print("Balance is below 0, add funds now or you will be charged a penalty.")

elif balance == 0:
print("Balance is equal to 0, add funds soon.")

else:
print("Your balance is 0 or above.")```

Now, there are three possible outputs that can occur once we run the program:

• If the variable balance is equal to 0 we will receive the output from the elif statement (Balance is equal to 0, add funds soon.)
• If the variable balance is set to a positive number, we will receive the output from the else statement (Your balance is 0 or above.).
• If the variable balance is set to a negative number, the output will be the string from the if statement (Balance is below 0, add funds now or you will be charged a penalty).
What if we want to have more than three possibilities, though? We can do this by writing more than one elif statement into our code.

In the grade program, let’s rewrite the code so that there are a few letter grades corresponding to ranges of numerical grades:

• 90 or above is equivalent to an A grade
• 80-89 is equivalent to a B grade
• 70-79 is equivalent to a C grade
• 65-69 is equivalent to a D grade
• 64 or below is equivalent to an F grade
To run this code, we will need one if statement, three elif statements, and an else statement that will handle all failing cases.

Let’s rewrite the code from the example above to have strings that print out each of the letter grades. We can keep our else statement the same.

```grade = 60

if grade >= 90:

elif grade >= 65:

else:

Since elif statements will evaluate in order, we can keep our statements pretty basic. This program is completing the following steps:

• If the grade is greater than 90, the program will print A grade, if the grade is less than 90, the program will continue to the next statement...
• If the grade is greater than or equal to 80, the program will print B grade, if the grade is 79 or less, the program will continue to the next statement...
• If the grade is greater than or equal to 70, the program will print C grade, if the grade is 69 or less, the program will continue to the next statement...
• If the grade is greater than or equal to 65, the program will print D grade, if the grade is 64 or less, the program will continue to the next statement...
• The program will print Failing grade because all of the above conditions were not met. Introduction

Write a program that:

1. Write an input line to ask a user whether they want to take the red pill or the blue pill.
2. If they write “red” then print “You stay in wonderland and see how far the rabbit hole goes”.
3. Elif they write “blue” then print “You wake up in your bed and believe what you want to believe.”.
4. Else print “That’s not an option Neo.”

Write a program that creates a multiple choice quiz of 4 possible answers.

Write a program that asks for a pupil score and outputs a suitable grade and comment. 9.3 ELSE IF Statement Task If you need to get in touch with Mr McG then this is the way….

Thank you [name], that's great.

Can I ask where you are from?
Hey [name], can I ask where you are from?
Hey [name], which class are you in?
OK [name], thanks for that.

Thanks [name], nearly there.