This is the tutorial text: >>> prefix = 'Py' >>> prefix 'thon' # can't concatenate a variable and a string literal ... SyntaxError: invalid syntax >>> ('un' * 3) 'ium' ... SyntaxError: invalid syntax This is the actual result: >>> prefix = 'Py' >>> prefix 'thon' # can't concatenate a variable and a string literal File "", line 1 prefix 'thon' # can't concatenate a variable and a string literal ^ SyntaxError: invalid syntax
But it also contains an error message part which has nothing to do with this example (marked in dark green) This only works with two literals though, not with variables or expressions: >>> prefix = 'Py'>>> prefix 'thon' # can't concatenate a variable and a string literal ...SyntaxError: invalid syntax>>> ('un' * 3) 'ium' ...SyntaxError: invalid syntax If you want to concatenate variables or a variable and a literal, use +: On Tue, Feb 19, 2019 at 10:58 AM Serhiy Storchaka <report@bugs.python.org> wrote: > > Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment: > > The output in tutorial is correct. "..." means omitted output (we don't > want to clutter examples with insignificant details). > > ---------- > nosy: +serhiy.storchaka > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker <report@bugs.python.org> > <https://bugs.python.org/issue36032> > _______________________________________ >
and when you execute the examples, the REPL does not generate the triple points. For me, the examples of the tuto are correct and we don't need to add '...' in the examples.
Uh! You meant Python 2.7!! It doesn't make sense to improve Python 2.7 tutorial. If you're reading Python 2 tutorial, please read 3.7 tutorial instead!!!