Hi Steven. 

Thank you for your answer below. The program now runs, using print("Game 
Over"). 

I use Python 3..; but the book - python for absolute beginner - that I have is 
an old (2003) edition. I don't know how this combination may affect my 
learning, going forward. Could you please suggest how I can something current. 


Regards.

Tayo.


My answer to your question appears below:



On Sun, Sep 09, 2012 at 03:56:22PM -0700, tayo rotimi wrote:
> My first exercise: print "Game Over" does not run! Where have I missed it? 
> The error message is as follows:
> 
> ?File "<stdin>", line 1
> ?? print "Game Over"
> ??? ??? ??? ??? ??? ^
> ?SyntaxError: invalid syntax 


Are you using Python 3 instead of Python 2?

One of the changes between the 2.x versions and the 3.x versions is that 
print is no longer a statement, but is now a function. That means you 
have to write it using round brackets (parentheses for Americans):

# version 2.x
print "Game Over"

# version 3.x
print("Game Over")


For simple printing, there's not much advantage either way, but for more 
advanced printing, the function form is much better.



-- 
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to