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

create a variable name treehouse by combining two strings "tree" and "house".

all I think is

name='tree'+'house'

but it gives an error

name.py
name='ratul'
treehouse='tree'+'house'

4 Answers

Hey Ratulsnigdha,

You need to capitalize the first letter in the word "tree". That should help you pass the challenge.

Below is my answer:

   treehouse = "Tree" + "house"
Timothy Bramlett
Timothy Bramlett
6,609 Points

String concatenation is done in Python with the + operator so you are definitely on the right track! Does it want the variable to be named "name" or does it want the variable to be named "treehouse"? What is the error it is giving you?

Ratulsnigdha,

I concur with Curtis above, try "Tree" instead of "tree". The use of plus sign (+) to concatenate strings is the correct syntax, however, the Treehouse tests are sometimes looking for specific style in code or resulting output as well. Luck!

Hi Guys,

Thanks so much :) I resolved it, the issue was that I did not use the word 'Tree' and rather typing 'tree'.