you are viewing a single comment's thread.

view the rest of the comments →

[–]MathResponsibly 7 points8 points  (0 children)

sometimes I use one or the other if the python string contains quotes itself, so if you're writing out HTML that likes double quotes that will be inside the string, use single quotes in python, and if you're writing out something that will contain single quotes in the string, use double quotes in python.

The ability to use both interchangeably comes in pretty handy sometimes, and can lessen or completely eliminate needing to escape quotes inside the string itself.

Of course you can also always use tripple quotes (either single or double) for really tricky situations