Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8494

Re: Python basic program problem

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 <enalicho@gmail.com>
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 <c07a7df7-0e26-4884-a237-cc0a1f148056@q14g2000prh.googlegroups.com>
References <c07a7df7-0e26-4884-a237-cc0a1f148056@q14g2000prh.googlegroups.com>
From Noah Hall <enalicho@gmail.com>
Date Mon, 27 Jun 2011 08:18:13 +0100
Subject Re: Python basic program problem
To Amaninder Singh <asingh0412@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.438.1309159116.1164.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh <asingh0412@gmail.com> wrote:
> 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
>>>>
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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python basic program problem Amaninder Singh <asingh0412@gmail.com> - 2011-06-27 00:05 -0700
  Re: Python basic program problem Noah Hall <enalicho@gmail.com> - 2011-06-27 08:18 +0100
  Re: Python basic program problem Daniel Kluev <dan.kluev@gmail.com> - 2011-06-27 18:19 +1100
  Re: Python basic program problem Andrew Berg <bahamutzero8825@gmail.com> - 2011-06-27 02:24 -0500
  Re: Python basic program problem Noah Hall <enalicho@gmail.com> - 2011-06-27 22:28 +0100

csiph-web