Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.