So, I recently started learning python and I am in the raw_input() section.
So while I was trying out different things, I made an error (at least that's what I think for now). Can someone please explain what is the difference between the two statements?
var1 = int(raw_input())
var1 = int((raw_input())
I know that the first one waits for an input from the user and assigns it to the variable var1
but, in the second case, this is the output I am getting.
>>> x = int((raw_input())
On pressing enter, it just shows the ellipses and waits for a user input.
... 12
Twelve was my input and then I get the following error.
File "<stdin>", line 2
12
^
SyntaxError: invalid syntax
I know it clearly says it is a Syntax Error but shouldn't it even accept the statement? Why does it wait for an in input?
Thank you.
Python Version: 2.7 OS: Windows