I read that the interpreter runs the code line by line and reports an error if it is at the same time, and stops further execution. So in python, consider the ex1.py file,
print "Hello world" 12variable = 'bye' print 12variable
Now, in accordance with the work of the interpreter, the interpreter will start the first line, that is, first prints the world hello, and then displays a syntax error in the next line (in turn). Therefore, the expected result:
Hello world 12variable = 'bye' ^ SyntaxError: invalid syntax
But the actual conclusion is
12variable = 'bye' ^ SyntaxError: invalid syntax
Why doesn't he print Hello World in the first place?
source share