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

Jaime Ponce
Jaime Ponce
209 Points

create a variable using a string

I am new at this and i am having issues with the question. Create a variable named "Treehouse" by combining two strings 'Tree' and 'House'

name.py
name='treehouse'
print(name+ 'house')

2 Answers

Hi Jaime,

At that point, your code should look something like:

name = "Steve"
treehouse = "Tree" + "house"

I hope that helps.

Steve.

Hey Steve, I did that and makes sence, however somehow the checker does not approve that! stills show as wrong code, also I printed it out on the console but no go

Can you paste your code please? Let's have a look at what might be wrong.

Steve.

If you typed that, then your code is absolutely correct. That would mean the task would pass - did you overwrite/delete the first task? That would cause an error as the code from each task is expected to stay in-place. I can't think of any other reason why that code would fail - does the compiler not provide a reason for the failure? It often gives some hints.

Steve.

Jaime Ponce
Jaime Ponce
209 Points

thanks for your help, that worked.

Sure, I did {code} treehouse = "Tree" + "house"{code}, it is not a big problem, I think it is more of the task checker, I dont know what it is expecting from us to write and it just makes me uncomfortable not being able to finish it.