[docs] [issue23396] Wrong print for 2.7.9

John Boersma report at bugs.python.org
Thu Feb 5 02:12:24 CET 2015


New submission from John Boersma:

In the tutorial for 2.7.9, in the section on quotes and the escape character, there is the following example text: 
>>> '"Isn\'t," she said.'
'"Isn\'t," she said.'
>>> print '"Isn\'t," she said.'
"Isn't," she said.
>>> s = 'First line.\nSecond line.'  # \n means newline
>>> s  # without print(), \n is included in the output
'First line.\nSecond line.'
>>> print s  # with print, \n produces a new line
First line.
Second line.

Note the print() in a comment. Isn't that Python 3 syntax? Should just be print for 2.7, I believe.

----------
assignee: docs at python
components: Documentation
messages: 235414
nosy: docs at python, johnboersma
priority: normal
severity: normal
status: open
title: Wrong print for 2.7.9
type: enhancement
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23396>
_______________________________________


More information about the docs mailing list