Anonymous user
Boston Python Workshop 8/Friday/Tutorial: Difference between revisions
Boston Python Workshop 8/Friday/Tutorial (view source)
Revision as of 14:39, 12 July 2013
, 10 years ago→even more choices: elif
imported>Jesstess |
imported>Jesstess |
||
Line 619:
====even more choices: <code>elif</code>====
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 <code>True</code> condition or reaches the default <code>else</code> block.
<pre>
|