Member Avatar for Alex_20

I'm getting this every time I try and write Hello, World in Python I get this. I'm using Pycharm 3

C:\Python33\python.exe C:/Users/Alex/PycharmProjects/Learning/Helloworld
  File "C:/Users/Alex/PycharmProjects/Learning/Helloworld", line 1
    print "Hello, World"
                       ^
SyntaxError: invalid syntax

Process finished with exit code 1

Recommended Answers

All 6 Replies

In python 3 print is a function.

You should write: print("Hello, World")

Member Avatar for Alex_20

It's fixed my brother solved it. Thanks slate. :)

I'm just a Python learner myself and I also struggled wit thisone.
In newer versions of Python (Python 3) print has become a function, so print("hello") should work.

Member Avatar for Alex_20

Thanks ddanbe, :). I was seeing alot of tutorials that was saying,

print "Hello, World!"

but it didn't work.

Actually, that works for 2.7, it depends on what version of Python you are using.

you must try python course at coursera.... its just awesome(even if u dont have time to do the assignments )

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.