-2

I tried running a python script: print "Hello, World!" but I get this error.

 File "hello.py", line 1 print "Hello, World!" ^ SyntaxError: invalid syntax

What is going on?

Abhishek Rai
  • 2,159
  • 3
  • 18
  • 38
  • 3
    Voting to close - duplicate of [What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?](https://stackoverflow.com/questions/25445439/what-does-syntaxerror-missing-parentheses-in-call-to-print-mean-in-python) – esqew Nov 28 '20 at 13:46

2 Answers2

0

The code you are writing is Python 2.x code, but your environment seems like Python 3.0.

here is code for python 3.x

print("Hello World")
Asim Khan
  • 1,969
  • 12
  • 21
-1

'Hello world' you can print hello world in similar manner

  • I think you are confusing the Python interactive interpreter with a script. Echoing a string object is **not the same thing as printing**. – Martijn Pieters Nov 28 '20 at 13:52