0

I having some problem with Python Hello World program. So, I follow the Python tutorial on the internet. I'm follow the tutorial to install the Python interpreter and created a python file named HelloWorld.py and it look like this:

print "Hello, World!"

But the Python interpreter show error when try to run it while the online compiler of the tutorial website didn't have any error! So, what wrong with my code?

Edit: Fixed.

  • 4
    This is (probably) for python 2. Try `print("Hello, world!")` instead. The tutorial must be using python 2, which is "dead". So don't follow that tutorial, and find another one. – j1-lee Jul 07 '22 at 01:12
  • 3
    You'll want to find a newer Python tutorial as well. If this tutorial has the Python 2 style `print` statements, then it's going to have a lot of other outdated nonsense and will just cause you more problems like this as you proceed. – Silvio Mayolo Jul 07 '22 at 01:13
  • Just for more information, you might want to check this: [Python 3 print without parenthesis](https://stackoverflow.com/questions/32122868/python-3-print-without-parenthesis) – hokwanhung Jul 07 '22 at 01:14

0 Answers0