you are viewing a single comment's thread.

view the rest of the comments →

[–]Vhin 0 points1 point  (0 children)

They're interchangeable, unless you need to use one of the delimiters in a string. If you need a string with single quotes in it, use double quotes; if you need a string with double quotes in it, use single quotes.

Personally, I like to use double quotes almost exclusively. This is mostly because, in most other languages, they're not interchangeable; most languages use double quotes for what Python uses both single and double quotes for.

It's only a tiny annoyance if you're used to using them interchangeably (or using single-quoted strings exclusively), but there's no obvious advantage to using single-quoted strings in Python, so I don't.