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 (Retired) Putting the "Fun" Back in "Function" Introduction To Functions

im so confused the difference between me="keith" and me='keith' can anybody tell me more about this?

the difference and the proper use of "" and ' '

1 Answer

Michael Hulet
Michael Hulet
47,912 Points

There is no difference (that I'm aware of) between using single quotes and double quotes to create strings. I generally use double quotes, personally, but I would think you should definitely use double quotes in a situations when your string contains an apostrophe or other single quotes, and you should use single quotes when your string would contain double quotes

i think the same way too.. but in some of quiz here it says "ERROR" whereas i see nothing wrong with the code but when i try to change it to single qoute . . BOOM IT PASSED!.. . i just found it weird but at least i know that my thoughts are right (just for my peace of mind). Maybe its the answer are programmed to be exact.

big thanks :)

Michael Hulet
Michael Hulet
47,912 Points

No problem! Did the string in the challenge use double quotes? If you post the code challenge & your code, I might be able to help you figure out why

i see. . i did checked it again!. . ur right its a good practice using double qoutes .. its was my mistake