Fixed small type
Major overhaul of Python version of example 3-4