Boston Python Workshop 8/Friday/Tutorial: Difference between revisions

Content added Content deleted
imported>Jesstess
imported>Jesstess
Line 619: Line 619:
====even more choices: <code>elif</code>====
====even more choices: <code>elif</code>====


If you need to execute code conditional based on more than two cases, you can use the <code>elif</code> keyword to check more cases. You can have as many <code>elif</code> cases as you want; Python will go down the code checking each <code>elif</code> until it finds a True condition or reaches the default <code>else</code> block.
If you need to execute code conditional based on more than two cases, you can use the <b><code>elif</code></b> keyword to check more cases. You can have as many <code>elif</code> cases as you want; Python will go down the code checking each <code>elif</code> until it finds a True condition or reaches the default <code>else</code> block.


<pre>
<pre>