Anonymous user
Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Boston Python Workshop 3/Friday/Tutorial (view source)
Revision as of 02:32, 17 June 2011
, 13 years ago→Types
imported>Jesstess (→Types) |
imported>Jesstess (→Types) |
||
Line 95:
* Functions encapsulate some useful bit of work. We save that useful bit of work inside the function so we don't have to type it over and over again every time we want to use it. So, for example, some nice person decided that being able to determine the type of an object was useful, so he or she put the Python code that figures out an object's type into the function <code>type</code>, and now we all get to use it, instead of having to write it ourselves.
* Functions are
* To use a function, write the name of the function followed by an open parenthesis, what the function takes as input (we call that input the <b>arguments</b> to the function), and then a close parenthesis.
|