4 Replies - 484 Views - Last Post: 19 May 2013 - 01:30 AM Rate Topic: -----

#1 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Hello World syntax error?

Posted 18 April 2013 - 06:51 PM

I seem to be getting a syntax error on the worlds simplest program...

This is what I have:
print "Hello World"




Any ideas?
NVM, apparently the tutorial I am following left out the fact I need parentheses.

This post has been edited by IngeniousHax: 18 April 2013 - 07:01 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Hello World syntax error?

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4332
  • View blog
  • Posts: 12,127
  • Joined: 18-April 07

Re: Hello World syntax error?

Posted 18 April 2013 - 08:48 PM

Just for future reference Python 2 didn't need the parenthesis when it came to Print. In Python 3.x they changed print so that you need parenthesis now. :)
Was This Post Helpful? 0
  • +
  • -

#3 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: Hello World syntax error?

Posted 19 April 2013 - 07:36 PM

Thank you Martyr2. I am enjoying python. Much more than PHP.
Was This Post Helpful? 0
  • +
  • -

#4 npanagakis  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 23
  • Joined: 01-December 12

Re: Hello World syntax error?

Posted 19 May 2013 - 12:33 AM

Good question, but make sure to include the error message next time. And you should probably download 2.7 if you are going to continue with that tutorial. Like martyr2 said, parenthesis are required in 3, so the guy that is doing the tutorials is probably using 2.7.

This post has been edited by npanagakis: 19 May 2013 - 12:34 AM

Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3360
  • View blog
  • Posts: 11,383
  • Joined: 12-December 12

Re: Hello World syntax error?

Posted 19 May 2013 - 01:30 AM

I would continue with version 3, no point reverting to older technology. It mainly means replacing

print "Something"    # with
print("Something")   # and

x = raw_input("Question?")    # with
x = input("Question?")

Even if you encounter other differences it will be useful to be aware of these differences, in case you ever have to work with Python 2.*.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1