Difference between " and '

jepler at unpythonic.net jepler at unpythonic.net
Thu Jul 21 21:07:00 EDT 2005


The only difference is when you want to include " or ' inside the string.  If
you want to include the "like" quote, then escape it ("\"", '\'').  If you
include the "unlike" quote, no escape is needed ("'" or '"').

I think that people new to programming will use '' if it is unshifted on their
keyboards.  People from a "C" background may use "" for strings (since in that
language, '' is for a single character only).

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050721/beff974c/attachment.sig>


More information about the Python-list mailing list