Two Announcements
- Download the Ultimate Python Cheat Sheet. It's succinct (one page) and very useful.
- This, from Sherry Liu
Hi Dr. Morrison! I was just wondering if you knew any girls in your classes who might be interested in computer vision forum? I am teaching the forum this semester and there are currently no other girls enrolled 🙁 Encouraging women in STEM is important to me, so just wanted see if you might know anyone who would be interested. Thanks!
A little more about functions
side effects A side effect is something that
happens that persists beyond the lifetime of a function. For example,
print
puts things to stdout
. Those things remain
after print
returns, and even remain after the program ends.
docstrings This is a triple-quoted string right after the function header.
help and how to get it
To get help use the help
function or use
.___doc__
precondtions Specify the number and types of inputs and anything else that should be true when calling this funcion.
postcondtions This is what is true once the function has done its job. This includes return value and any side effect.