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) Ins & Outs Ins & Outs

David Marsh
David Marsh
189 Points

how to make a treehouse variable in python

how can i make a treehouse variable in python. i don't really understand it.it confuses me. please help.

name.py

2 Answers

YI LI
YI LI
4,094 Points

Hello David, I think you are asking the third challenge, "Finally, create a new variable named email_greeting that combines the treehouse variable, the string "loves", and the name variable with spaces between each item.". Is it? It is come from the second challenge. We have created treehouse variable(treehouse = "Tree"+"house"), so what we need to do is combining them as the question said: email_greeting = treehouse+" loves "+name

Sean T. Unwin
Sean T. Unwin
28,690 Points

We are able to join strings using the + operator.

If you need help with concatenating Strings I would suggest to rewatch the String Concatenation video.

For the third part of the challenge, we may use the format() function. Explanation and examples can be found by watching the String Formatting video.