[Tutor] Extremely simple question
col speed
ajarncolin at gmail.com
Wed Jan 11 14:17:07 CET 2012
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
More information about the Tutor
mailing list