If both are valid, why would you use double or single quotes for any given string?
It depends on the string you’re writing or storing for sure. The important thing is to always have the same type of quote on the outside, and always have a closing outside quote for an opening outside quote.
If we need to write a string with an apostrophe in the middle, it’s best to use double quotes on the outside, otherwise it’ll think we have an extra quote!
print “This looks right, doesn’t it?” print ‘This doesn’t look right, does it?’
See how the second example looks like we closed off our string after the ‘n’ in “doesn’t”?
Another common practice is using double quotes for strings and single quotes for single characters, like ‘n’.