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


Groups > comp.lang.python > #22186 > unrolled thread

Re: help needed to understand an error message.

Started byJean-Michel Pichavant <jeanmichel@sequans.com>
First post2012-03-26 15:26 +0200
Last post2012-03-26 15:26 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#22186 — Re: help needed to understand an error message.

FromJean-Michel Pichavant <jeanmichel@sequans.com>
Date2012-03-26 15:26 +0200
SubjectRe: help needed to understand an error message.
Message-ID<mailman.1000.1332768387.3037.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web