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 trialAbe Daniels
Courses Plus Student 2,781 PointsHow do I create a variable by putting existing variables into the sentence?
I created two variables. I then created a sentence using the two variables. Treehouse is saying that I did not include one of the variables.
name = "Nick"
treehouse = "Tree" + "house"
email_greeting = "(treehouse) loves (name)"
1 Answer
Stanley Hataria
1,168 PointsHi there,
You will have to use format in the string.
eg:
name= "{} loves {}".format(treehouse,name)
Hope this helps