Difference between revisions of "Boston Python Workshop 3/Friday/Tutorial"
, 10 years ago
* They do some useful bit of work.
* They let us re-use code without having to type it out each time.
* They take input and possibly produce output. You can assign a variable to this output.
* You call a function by using its name followed by the input in parenthesis.
Running this assigns the type of <code>my_var</code> -- a boolean -- to <code>x</code>.
We can right our own functions to encapsulate bits of useful work so we can reuse them. Here's how you do it: