Reputation: 13
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
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
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