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 trialPaul Resendez
338 PointsPlease help!
Please help! I am new to programming and I am having difficulty with this seemingly simple problem. I feel that I must be missing something obvious.
name = "Paul"
treehouse = "Tree" + "house"
email_greeting = "treehouse" + "loves" + "name"
3 Answers
Ken Alger
Treehouse TeacherPaul;
Welcome to Treehouse!
In your email_greeting
variable you are not using your name
or treehouse
variables. You are using strings and have not added the requested spaces. Your code is currently returning:
treehouselovesname
Do you recall from the video how to concatenate strings together?
Happy coding,
Ken
Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi Paul
you have stored the your string values in variables called name and treehouse. Your problem is instead of concatenating your variables treehouse and name to the email_greeting variable you are concatenating two strings names "treehouse" and "name".
I personally always like to use the format method of the string class where you substitute your values for the {} like this.
name = "Paul"
treehouse = "Tree" + "house"
email_greeting = "{} loves {}".format(treehouse,name)
Paul Resendez
338 PointsGreat, thanks for the help!
Paul Resendez
338 PointsPaul Resendez
338 PointsThis is the problem: "Finally, create a new variable named email_greeting that puts the treehouse variable and the name variable into the sentence "X loves Y" but with treehouse for X and name for Y. Don't forget your spacing!"