Meeting 02: Prerequisites and Python
These are just the notes that document what I demonstrate in class. You can use this list as a guide to reading the python tutorial.
- which Python? 2.7.x vs 3 and CPython, PyPy, Jython, IronPython
- Interaction: the REPL, IDLE, ipython notebook, and Spyder, etc.
- help and the online python documentation
- strong dynamic typing, objects: id, type, value
- variables are names refering to objects
- garbage collection
- Basic types: bool, numerics, sequences, set/dictionary, file
- Numeric types: int, float, complex
- Sequence types: string, tuple, list
- sets and dictionary
- Flow control: if/else, while, for, exceptions
- note on indentation and blocks, running from scripts
- defining functions: first class, pass by ref, attributes
- classes and polymoprhism (inheritance)
- Modules
- Doc strings
- Many more advanced things, e.g. list comprehensions
Common data structures
- stack = python list with append and pop methods
- queues = collections module deque, or module Queue
- trees = python list of lists
- graphs = node objects with linked references