add chapters 3 and 4 from python tutorial