Strings: double versus single quotes
Terry Reedy
tjreedy at udel.edu
Tue May 19 20:47:48 EDT 2020
On 5/19/2020 2:10 PM, Manfred Lotz wrote:
> Hi there,
> I am asking myself if I should preferably use single or double quotes
> for strings?
>
> If I need a single quote in a string I would use double quotes for the
> whole string and vice versa. For f-strings I mostly see double
> quotes but single quotes would work as well I think.
>
> Is there a recommendation?
I personally like to use "This is a phrase or sentence" while '0', '\n',
and 'work' are items or words.
# And this is a comment 'quoted' by '#' and '\n'.
--
Terry Jan Reedy
More information about the Python-list
mailing list