Maybe the tutorial is using Python 2. Always provide a SSCCE and, when it makes sense, the error message.