Python 3.1: Syntax error for everything! (Mac OS X)

I upgraded to Python 3.1.3 (I have OS X 10.6).

If I find pythonin the terminal, I get a working environment of 2.6.1.
If I type python3in the terminal, I get the environment 3.1.3. Everything looks great until I do nothing. If I try to run print "hello", I will get a syntax error.
This problem is the same in IDLE.

I tried to uninstall everything for 3.1 and then reinstall, but it did not work.

Ideas?
Thanks in advance!

+3
source share
2 answers

In Python 3, you need to use Print as a function:

print("Hello")
+8
source

Python 3.x print ,

print("Hello")

.

+10

Source: https://habr.com/ru/post/1785665/


All Articles