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

Content added Content deleted
imported>Jesstess
imported>Jesstess
Line 677: Line 677:
</pre>
</pre>


Running this assigns the length of the string "Mississippi" to the variable <code>length</code>.
Executing this code assigns the length of the string "Mississippi" to the variable <code>length</code>.


We can write our own functions to encapsulate bits of useful work so we can reuse them. Here's how you do it:
We can write our own functions to encapsulate bits of useful work so we can reuse them. Here's how you do it: