Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'directions': 0.04; 'subject:Python': 0.06; '>>>>': 0.09; 'through.': 0.09; 'syntax': 0.11; 'am,': 0.13; 'wrote:': 0.15; '"copyright",': 0.16; '"credits"': 0.16; 'tutorial.': 0.16; '\xa0print': 0.16; 'cc:addr:python-list': 0.16; 'mon,': 0.17; 'suggest': 0.17; '2.x': 0.19; 'singh': 0.19; 'working.': 0.19; 'received:74.125.82.44': 0.19; 'received:mail-ww0-f44.google.com': 0.19; 'subject:problem': 0.19; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'trying': 0.23; 'code': 0.24; '"this': 0.25; 'invalid': 0.25; 'keyword': 0.25; 'says': 0.25; 'message-id:@mail.gmail.com': 0.28; 'version,': 0.28; 'import': 0.29; '27,': 0.29; 'cc:addr:python.org': 0.30; 'fairly': 0.30; '3.x': 0.30; 'hi,': 0.30; 'looks': 0.30; 'print': 0.32; 'error.': 0.36; 'received:google.com': 0.37; 'but': 0.37; 'using': 0.38; 'subject:: ': 0.38; 'help': 0.39; 'received:74.125.82': 0.39; 'appreciated.': 0.40; 'received:74.125': 0.40; 'more': 0.60; 'your': 0.61; 'jun': 0.67; 'subject:program': 0.67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=xJYXVKpBMIW6eR6SgHil8SdFJVRFXhQa8AYR9JI6DNo=; b=TME3kEZAVG2u9aK8NrVVls9CJN9wRoZKhxKYeBpJLfowciDnpjpmt3HLegzL5sdxf3 VFoimIVQNyERjaJpBdZr15WsaUKC6ezmSsx6WcgW/X+d+Z6Z9m9aTK8IBnLAPf06H2RW w6rMTAg+KN7Ex0ffypcEUqMQNFTmSc1gKVpWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=JXvUMo/Pzw6eVDXU4dLUbscGpwugMZqPp7FC/7JOUVXXNXAaYiEXSXcHYliVpO2gaz wHHH7uyBee9KoN8RTQ3gY//03J9U4FDnB+m5czJ9kshmc3+uXg4Z8K54yQe1XqHaTyIc eEIhR2XoefcVZ7ni3srnY6UQqrRZKYh5mUZ58= MIME-Version: 1.0 In-Reply-To: References: From: Noah Hall Date: Mon, 27 Jun 2011 08:18:13 +0100 Subject: Re: Python basic program problem To: Amaninder Singh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 42 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1309159116 news.xs4all.nl 4360 [::ffff:82.94.164.166]:49206 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8494 On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh wro= te: > 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 =3D 2 >>>> if x =3D=3D 2: > =A0 print "This is a test" > > SyntaxError: invalid syntax >>>> if x =3D=3D 2: > =A0 =A0 =A0 =A0 =A0 print "This is a test" > > SyntaxError: invalid syntax >>>> x =3D 2 >>>> if x =3D 2: > > SyntaxError: invalid syntax >>>> if x =3D=3D 2: > =A0 =A0 =A0 =A0print "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 >>>> Looks like you're using the 3.x version, while your guide is 2.x. I suggest you download the 2.x version, or find a new tutorial. HTH