Anonymous user
Boston Python Workshop 3/Friday/Tutorial: Difference between revisions
Boston Python Workshop 3/Friday/Tutorial (view source)
Revision as of 01:44, 17 June 2011
, 13 years ago→Types
imported>Jesstess (→Output) |
imported>Jesstess (→Types) |
||
Line 95:
* Functions do 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 a lot like functions in math class. You provide input to a function
* To use a function, write the name of the function followed by an open parenthesis, possibly some data (we call that data the <b>arguments</b> to the function), and then a close parenthesis.
|