"
I have read that the interpreter runs the code line by line and reports the error if any at the same time and stops the further execution. So in python, consider the file ex1.py,
print "Hello world"
12variable = 'bye'
print 12variable
Now according to the working of interpreter, the interpreter would run the first line i.e. it prints hello world first and then show the syntax error in the next line (line-by-line working). Hence the expected output is:
Hello world
12variable = 'bye'
^
SyntaxError: invalid syntax