AC18
AC18

Reputation: 13

Three Dots In Python Console after making a mistake

Whenever I Make A Mistake In The Python Terminal, I Come across the three dots(as given below), However When I Then write the correct code, it gives a syntax error, but when I write the same code again, I get the desired output, Could someone please explain as to why this happens and what exactly happens.

Thanks.

>>> age=14_567_3745_4
>>> print(age0
... print(age)
  File "<stdin>", line 2
    print(age)
    ^
SyntaxError: invalid syntax
>>> print(age)
1456737454

Upvotes: 1

Views: 2883

Answers (2)

JDunken
JDunken

Reputation: 463

What you have run into is called 'implicit line joining' in python. Have a look at the docs, https://docs.python.org/2.0/ref/implicit-joining.html

Upvotes: 1

popeye
popeye

Reputation: 896

As indicated by @MisterMiyagi it is expecting you to just complete the statement and not write it all over again, something like this:

>>> age = 1341
>>> print(age
... )
1341

Upvotes: 1

Related Questions