Anonymous user
Boston Python Workshop 8/Friday/Tutorial: Difference between revisions
Boston Python Workshop 8/Friday/Tutorial (view source)
Revision as of 14:36, 12 July 2013
, 10 years ago→more choices: if and else
imported>Jesstess |
imported>Jesstess |
||
Line 558:
====more choices: <code>if</code> and <code>else</code>====
Use the <b><code>else</code></b> keyword, together with <code>if</code>, to execute different code when the <code>if</code> condition isn't <code>True</code>. Try this:
<pre>
Line 569 ⟶ 571:
</pre>
Like with <code>if</code>, the code block under the <code>else</code>
====compound conditionals: <code>and</code> and <code>or</code>====
|