I have created a MWE:
x = True
if x:
print('111111')
y = 1
When running in python interactive mode, I get
>>> x = True
>>> if x:
... print('111111')
... y = 1
File "<stdin>", line 3
y = 1
^
SyntaxError: invalid syntax
>>>
The code looks very correct. If I add them line by line, they will be fine but now when copying them all together.
What is wrong?