Lecture notes implimented in python.