[Courses] python

Leslie leslie.brothers at verizon.net
Tue Jun 21 21:44:06 UTC 2011


In reply to:
	Hi all,

	Is there a benefit to using single quotes instead of double in
Python?
	Are single quotes more literal?

	Farhan Yousaf

I am a beginner myself, but I read somewhere recently that there is
actually a disadvantage to using single quotes instead of double quotes.
If you start a string with a a single quote, and the string contains an
apostrophe (example: 'Here's your milk.'), Python will see the
apostrophe as the end of the string ('Here' would be where it would stop
reading the string).
I am happy to be corrected if I am wrong or there is a better answer to
Farhan.

-Leslie Brothers



More information about the Courses mailing list