Python Python Basics (2015) Python Data Types Strings

What is the purpose of using different quote marks? (', ", etc)

Is there any significance/difference? Or is this choice purely aesthetic?

1 Answer

Diego Holt: Some languages the significance of the double vs. single quotes does matter. There's also a difference between using the single quote mark in the tilde button (above the tab button and next to the 1 on a Windows keyboard) and the single quote mark next to the enter key: ' . I've jumped around enough that I can't quite recall with Python, but I do remember that you have to think about potential problems like apostrophes and such. It's also good to be consistent in terms of once you choose a quote type, stick with that throughout the code.

So here's 2 examples:

"Moriarty told Sherlock, "Baby you should see me in a crown!" <--This would cause a problem because there are 2 starting quote marks

'I wasn't about to help you, but that's how it's gotta be.' <--this will cause a problem for the same reason

Craig goes into a break technique in a future video that allows you to create an apostrophe without having the problem.