python - How to prevent closing of " in variable -


i have variable

sentence = "in 1794, shortly after arrival in manchester, dalton elected member of manchester literary , philosophical society, "lit & phil", , few weeks later communicated first paper on "extraordinary facts relating vision of colours", in postulated shortage in colour perception caused discoloration of liquid medium of eyeball. in fact, shortage of colour perception in people had not been formally described or officially noticed until dalton wrote own. since both , brother colour blind, recognized condition must hereditary." 

now may have both "" , '' due close value of variable. want prevent this. there other way of storing string?

escape embedded quotes \:

"some text \"embedded\" quotes" 

if text contains double quotes, can single quotes , not have escape double quotes:

'some text "embedded" quotes' 

last not least, can triple outer quotes , save having escape newlines too:

"""some text "embedded" quotes""" """some text "embedded" quotes , newline too""" 

for example, single quotes trick:

sentence = 'in 1794, shortly after arrival in manchester, dalton elected member of manchester literary , philosophical society, "lit & phil", , few weeks later communicated first paper on "extraordinary facts relating vision of colours", in postulated shortage in colour perception caused discoloration of liquid medium of eyeball. in fact, shortage of colour perception in people had not been formally described or officially noticed until dalton wrote own. since both , brother colour blind, recognized condition must hereditary.' 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -