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 trialJon Willey
6,102 Pointshow to combine "Tree " and "House" into a variable .
Seems really simple but I can't get it . I've watched the video a couple times. Still not sinking in..
name = 'jon'
var1="Tree"
var2="House"
treehouse=var1 + var2
1 Answer
kirkbyo
15,791 PointsHi Jon,
Instead of combining var1 and var2 you can simply just add the two string together at the time of creating the variable. For example
hello = "Hello" + "World"
Your way will still get the job done, but the task won't accept that for some reason.
Hope this helped. If you have any other questions let me know,
Ozzie
EDIT:
Looks like I was wrong, the task will accept your code just instead of having a capital "H" when creating var2
change to a lowercase.
name = 'jon'
var1 = "Tree"
var2 = "house"
treehouse = var1 + var2
Jon Willey
6,102 PointsJon Willey
6,102 Pointsgot it! thanks