On 17/03/15 04:13, Nick Nguyen wrote:
Hi,
I use python 3.4.3.
I'm using print function with triple quote,
> as I understand all the character will be printed
as exactly within the triple quote, even with
> the backslash character.
You understand wrongly.
Triple quotes are no different to any other kind
of quote except that they can span lines. If you want
to print all the characters (with any kind of quote)
you must precede the quotes with r, for raw.
>>> print ("""A string with \t in it""")
A string with in it
>>> print (r"""A string with \t in it""")
A string with \t in it
>>>
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor