Anonymous user
Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Boston Python Workshop 3/Friday/Tutorial (view source)
Revision as of 22:40, 15 June 2011
, 13 years ago→Writing Functions
imported>Jesstess |
imported>Jesstess |
||
Line 673:
return x + y
</pre>
You can return any Python object: numbers, strings, booleans ... even other functions!
<b>Step 4: use the function</b>
Once you define this function, you can use it:
Line 681 ⟶ 685:
</pre>
Functions don't have to return anything, if you don't want them to. They usually return something because we usually want to be able to assign variables to their output.
==End of Part 2==
|