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

imported>Pamela01
 
Line 558:
====more choices: <code>if</code> and <code>else</code>====
 
<b><code>if</code></b> let'slets you execute some code only if a condition is <code>True</code>. What if you want to execute different code if a condition is <code>False</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:
Anonymous user