[Tutor] Extremely simple question

Adam Stogner stognera at gmail.com
Wed Jan 11 17:20:37 CET 2012


You should be using double quotes on this line and you are missing the last
quote:

print 'You're not Chris!

Should be:

print "You're not Chris!"


On Wed, Jan 11, 2012 at 8:17 AM, col speed <ajarncolin at gmail.com> wrote:

> On 11 January 2012 20:11, Max S. <maxskywalker1 at gmail.com> wrote:
> > I believe that line 3 raises an error.  The because you contained the
> text
> > in single quotes, and then used the same character in 'you're not chris',
> > Python believes that you are trying to type "you" re not chris".  You can
> > change the single quotes surrounding your string to double quotes
> ("you're
> > not chris"), triple-single quotes ('''you're not chris'''), or
> triple-double
> > quotes ("""you're not chris"""), or you can tell Python that you want to
> > include the apostrophe in your string by preceding it with a \ ('you\'re
> not
> > chris').  The latter works on the same idea as \n and \t.
> >
> How didn't I see that?
> It just goes to show a gooddun from a baddun.
> Cheers
> Col
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120111/b0014044/attachment.html>


More information about the Tutor mailing list