Syntax error for print

J

jsm4321

IDLE 3.0


Any idea on why I am getting this error.
I have just started learning python and I am stuck at first thing
itself.
Any help would be greatly appreciated.


Thanks,
Jeetu Sahil
 
B

bearophileHUGS

IDLE 3.0>>> print "hello"



SyntaxError: invalid syntax (<pyshell#5>, line 1)



Any idea on why I am getting this error.
I have just started learning python and I am stuck at first thing
itself.
Any help would be greatly appreciated.

Thanks,
Jeetu Sahil

The print of Python3 needs parentheses:

print(var)

Older Python versions are different.

Bye,
bearophile
 
J

jsm4321

Thanks Bearophile.

I should have used a tutorial for Python 3.0

I was reading tutorial for Python 2.5
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top