This is compatible with python2 and python3 so the examples don't throw a SyntaxError when trying them with python 3. Closes #329