apostrophe or double quote?

Christoph Zwerschke cito at online.de
Wed Feb 8 03:44:16 EST 2006


Steve Holden wrote:
> It's just easier to have two permitted string quotes. That way, if your 
> string has an apostrophe in it you can say
> 
>     s = "it's"

It's particularly handy if you are building strings of a language that 
already has its own quotes, e.g. SQL or XML:

sql_snippet = " where name='Max'"
html_snippet = ' align="left"'

-- Christoph



More information about the Python-list mailing list