Skip to content

Commit 2d2eb88

Browse files
authored
Merge pull request #1001 from MYPei/extra-diagrams
Extra diagrams for 07-cond.md Hi @MYPei , Thank you for the pull request and contribution to the visual aspect of the lesson. We will merge your diagrams workflow with the main lesson.
2 parents e6c1c87 + 3a30c21 commit 2d2eb88

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

_episodes/07-cond.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ freeing us from having to manually examine every plot for features we've seen be
268268
> > ## Solution
269269
> > C gets printed because the first two conditions, `4 > 5` and `4 == 5`, are not true,
270270
> > but `4 < 5` is true.
271+
> > In this case only one of these conditions can be true for at a time, but in other
272+
> > scenarios multiple `elif` conditions could be met. In these scenarios only the action
273+
> > associated with the first true `elif` condition will occur, starting from the top of the
274+
> > conditional section.
275+
> > ![A flowchart diagram of a conditional section with multiple `elif` conditions and some possible outcomes.](../fig/python-else-if.png)
276+
> > This contrasts with the case of multiple `if` statements, where every action can occur
277+
> > as long as their condition is met.
278+
> > ![A flowchart diagram of a conditional section with multiple `if` statements and some possible outcomes.](../fig/python-multi-if.png)
271279
> {: .solution}
272280
{: .challenge}
273281

fig/python-else-if.png

104 KB
Loading

fig/python-multi-if.png

103 KB
Loading

0 commit comments

Comments
 (0)