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


Groups > comp.lang.python > #22186

Re: help needed to understand an error message.

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=42574d81d=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:error': 0.03; 'interpreter': 0.07; '[2]:': 0.09; 'python': 0.11; 'print': 0.15; 'hint': 0.16; 'indicates': 0.16; 'to:name:python list': 0.16; 'subject:help': 0.17; 'exercise': 0.18; 'typing': 0.18; 'programming': 0.21; 'wrote:': 0.21; 'indicated': 0.22; 'header :In-Reply-To:1': 0.22; 'header:User-Agent:1': 0.23; 'syntax': 0.23; 'code.': 0.24; 'error': 0.25; 'file': 0.29; 'skip:* 60': 0.30; 'hi,': 0.33; 'too': 0.35; 'should': 0.35; 'why': 0.36; 'url:org': 0.36; 'correct': 0.38; 'to:addr:python-list': 0.39; 'to:addr:python.org': 0.40; 'learning': 0.61; 'however': 0.62; 'header:Received:2': 0.63; 'capital': 0.69; 'received:194': 0.72; 'subject:message.': 0.84; 'mistake': 0.91; 'anyway,': 0.93
X-IronPort-AV E=Sophos;i="4.75,320,1330902000"; d="scan'208";a="276425"
X-Virus-Scanned amavisd-new at zimbra.sequans.com
Date Mon, 26 Mar 2012 15:26:24 +0200
From Jean-Michel Pichavant <jeanmichel@sequans.com>
User-Agent Mozilla-Thunderbird 2.0.0.24 (X11/20100328)
MIME-Version 1.0
To Python List <python-list@python.org>
Subject Re: help needed to understand an error message.
References <CABWU=Q=vTsjb=DU7kcB71QQ4miSnyapt+_ExeE0Qx094mdK_7w@mail.gmail.com> <CABWU=QkG9riG9-1Cfhe2xoC0jjsw-Xp9S8QUCLBmRN482g2nwA@mail.gmail.com>
In-Reply-To <CABWU=QkG9riG9-1Cfhe2xoC0jjsw-Xp9S8QUCLBmRN482g2nwA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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.1000.1332768387.3037.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332768387 news.xs4all.nl 6987 [2001:888:2000:d::a6]:49756
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22186

Show key headers only | View raw


Aloke Ghosh wrote:
> Hi,
> I am learning Python and do not have programming experience.
> I was following 
> an exercise from http://learnpythonthehardway.org/book/ex2.html
> and made a mistake in entry :
>
> *Print"I like typing this."* 
>
> and got the following error message:
>
> *In [2]: Print"I like typing this."*
> *------------------------------------------------------------*
> *   File "<ipython console>", line 1*
> *     Print"I like typing this."*
> *                                        ^*
> *SyntaxError: invalid syntax*
>
> I feel the error is in Capital P in print .
> However the error indicated with "*^*" 
> hints at quote at the end of the line.
>
> *Can any one please help me understand this.*
>
> -- 
> A.K.Ghosh
Why don't you just try with a lowercase p ?

The correct syntax would be

print "I like typing this"

or in Python 3:

print ("I like typing this")

Anyway, the hint indicates the last quote because this is the location 
where the python interpreter realizes it won't be able to execute the 
code. You should not worry about that too much.

JM

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


Thread

Re: help needed to understand an error message. Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-03-26 15:26 +0200

csiph-web