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 trialAleksandra Ivanova
279 PointsWhere to use quotation marks?
I do understand they are needed inside parenthesis when they are an argument, per say, of some function. But if I just need to write a line of a text, where I am using variable, what should be in the quatation marks "" ?
favorite_color = "gray"
"The color" favorite_color "is my favorite!"
1 Answer
Steven Parker
231,269 PointsThe quotes are in the right places; but to output a message, the whole thing should be passed as the argument to a "print()
" function.
Also, the strings and variable name should be separated either by commas (to make them individual arguments) or by plus signs ("+", to concatenate them into a single string).