Python basic program problem

Amaninder Singh asingh0412 at gmail.com
Mon Jun 27 03:05:37 EDT 2011


Hi,
I am fairly new to python, I am trying to write simple code and It is
giving me syntax error. I am reading a book and following the
directions as it says in the book but I am not sure why it is not
working. Please guide me through. Any help appreciated.
>>> x = 2
>>> if x == 2:
   print "This is a test"

SyntaxError: invalid syntax
>>> if x == 2:
	   print "This is a test"

SyntaxError: invalid syntax
>>> x = 2
>>> if x = 2:

SyntaxError: invalid syntax
>>> if x == 2:
	print "This is test"

SyntaxError: invalid syntax
>>> Type "copyright", "credits" or "license()" for more information.
SyntaxError: invalid syntax
>>>
>>>
>>> print "this is a test"
SyntaxError: invalid syntax
>>> import keyword
>>> print keyword.kwlist
SyntaxError: invalid syntax
>>> print "hellow world"
SyntaxError: invalid syntax
>>> print 'hellow world'
SyntaxError: invalid syntax
>>>



More information about the Python-list mailing list