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

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


If you have 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> condition until it finds a true condition or reaches the default <code>else</code> block.
If you have 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.


<pre>
<pre>