Use print function in docs for Python 3 compatibility

It's great that there is so many working examples in the docs.
This PR changes from the print statement to the print function so that they also work with Python 3.