Это потому, что вы используете Python 2:
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello", end="")
File "<stdin>", line 1
print("hello", end="")
^
SyntaxError: invalid syntax
В Python3 этого не произойдет:
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello", end="")
hello>>>