Anonymous user
Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Boston Python Workshop 3/Friday/Tutorial (view source)
Revision as of 01:39, 17 June 2011
, 13 years ago→even more choices: elif
imported>Jesstess |
imported>Jesstess |
||
Line 643:
</pre>
You don't have to have an <code>else</code> block, if you don't need it. That just means there isn't default code to execute when none of the cases match:
<pre>
Line 654:
print "Valentine's Day color!"
</pre>
If color had been "purple", that code just wouldn't have printed anything.
==Writing Functions==
|