Python code for class.coursera.org/datasci-002