Python: what kind of literal delimiter is “better” to use

pythonstring

What is the best literal delimiter in Python and why? Single ' or double "? And most important, why?

I'm a beginner in Python and I'm trying to stick with just one. I know that in PHP, for example " is preferred, because PHP does not try to search for the 'string' variable. Is the same case in Python?

Best Answer

' because it's one keystroke less than ". Save your wrists!

They're otherwise identical (except you have to escape whichever you choose to use, if they appear inside the string).