osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strings: double versus single quotes


On 2020-05-23 14:46, Dennis Lee Bieber wrote:
> On Sat, 23 May 2020 11:03:09 -0500, Tim Chase
> >But when a string contains both, it biases towards single quotes:
> >  
> >   >>> "You said \"No it doesn't\""  
> >   'You said "No it doesn\'t"'  
> 
> 	This is where using triple quotes (or triple apostrophes)
> around the entire thing simplifies it all... (except for a need to
> separate the four ending quotes)

Unless you're pathological. ;-)

>>> """I said "This contain every type of \"""Python\""" '''triple-quoted''' string, doesn't it?\""""
'I said "This contains every type of """Python""" \'\'\'triple-quoted\'\'\' string, doesn\'t it."'

And-you-can-quote-me-on-that'ly yers,

-tkc