Nathan
Nathan

Reputation: 7032

Python 3.1: Syntax Error for Everything! (Mac OS X)

I updated to Python 3.1.3 (I've got OS X 10.6).

If I type python in Terminal, I get a working 2.6.1 environment.
If I type python3 in Terminal, I get a 3.1.3 environment. Everything looks fine until I do something. If I try to run print "hello", I get a syntax error.
This problem is the same in IDLE.

I tried deleting everything for 3.1 and then reinstalling, but it hasn't worked.

Ideas?
Thanks in advance!

Upvotes: 3

Views: 3673

Answers (2)

TyrantWave
TyrantWave

Reputation: 4663

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

print("Hello")

Upvotes: 8

Sven Marnach
Sven Marnach

Reputation: 601361

In Python 3.x, print is a function, so use

print("Hello")

instead.

Upvotes: 10

Related Questions