Aug-31-2017, 04:22 PM
It depends, and is sort of a personal preference.
The actual pep (most recent) can be viewed here: https://www.python.org/dev/peps/pep-0498/
I like to use single quotes, but use double if string contains single quote, or vice-versa,
(single quote if string contains double quote). If the string contains both single or double, the one
that is the same as that selected for the whole string will have to be escaped,example: '' for a single quote,
or "" for double quote
The actual pep (most recent) can be viewed here: https://www.python.org/dev/peps/pep-0498/
I like to use single quotes, but use double if string contains single quote, or vice-versa,
(single quote if string contains double quote). If the string contains both single or double, the one
that is the same as that selected for the whole string will have to be escaped,example: '' for a single quote,
or "" for double quote