Updated examples to work in Python 3.
Merge pull request #509 from judy2k/fix-examples

Updated examples to work in Python 3.