0

I have just downloaded Python 3.3.2 to use on windows7 and run the msi file to install. After installation I have tried using the prog only to find that every time I run my initial print 'hello world' it keeps reporting a syntax error. I have tried both single and double quotes but each time reports a syntax. It will add say 8 + 9 and return the answer but no joy with using a print statement. I have tried both the shell and a new window but without success. Any advice please much appreciated.

asked Oct 18, 2013 at 10:00

2 Answers 2

1

If you are using Python 3.x, you have to do print('hello world').

In Python 2.x, print was a statement, like if, for, etc. Now it is a function, thus the ().

answered Oct 18, 2013 at 10:02
Sign up to request clarification or add additional context in comments.

Comments

1

You're probably using instructions for a python-2 program, where print was a statement, rather than a function. In python>= 3, you have to do print(something), rather than just print something.

answered Oct 18, 2013 at 10:02

1 Comment

Since no one else seems to be interested in this question anymore, and it is the right answer, here's my +1, even though your answer was 16 seconds later than mine. :-P

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.