I just started a job where I'm writing Python after coming from a Java background, and I'm noticing that other developers tend to quote strings using single quotes (''
) instead of double quotes (""
). For example:
line1 = 'This is how strings typically look.'
line2 = "Not like this."
Is there a particular reason for this other than personal preference? Is this the proper way to be quoting strings? Specifically, what I want to know is if there is some type of standard or accepted best practice that drives this style of coding.
Ruby
, there actually is a technical difference between single and double quotes. Double quotes support string interpolation - single quotes parse as literals.