There's a typo in the Python 2.7 tutorial, section 3.1.2: >>> 'doesn\'t' # use \' to escape the single quote... "doesn't" should be: >>> 'doesn\'t' # use \' to escape the single quote... 'doesn\'t'