Python strings: single vs double quotes

Self-tutoring about Python: the tutor mentions double vs single quotes.

So far as I can tell, there is no difference between enclosing a string in single, compared with double, quotes in Python. (In some other languages there is a difference.) However, if one type is in the string already (for instance, an apostrophe), then the string should be enclosed in the other kind, unless the internal one is escaped. That’s my experience.

Source:

tutorialspoint.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply