`if-elseif-else`

are the building blocks of any modern program. They help us take decisions.

Consider a real-world decision. You are a student, and you only need to carry your Maths book if your maths teacher is coming to give a lecture. You make a mental note like this:

```
if maths_teacher == true
print "bring maths book to school"
else
print "no need to carry maths book!"
end
```

but, you need to carry your geometry book in case the geometry teacher comes in place of maths teacher, so you write:

**Elsif** refers to that branch of code that is checked **only if** the previous condition failed.

```
if maths_teacher== true
print "bring maths book to school"
elsif geometry_teacher == true
print "bring geometry book to school"
else
print "no need to carry maths/geomtery book!"
end
```

remember that here the elsif branch is only checked if the `if`

condition failed. When you are printing `"bring geometry book to school"`

you are certain that the boolean `geometry_teacher`

was `true`

and `maths_teacher`

was `false`

. Because `maths_teacher`

boolean was `false`

, the `elsif`

condition was checked and because `geometry_teacher`

boolean was `true`

, the `elsif`

part's `print`

statement got executed.

Hope that helps!