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

Mario Miranda
Mario Miranda
7,829 Points

Stuck on Python basics question.

Getting stuck on this Python basics question. Not sure where my mistake is.

name.py
name = 'Mario'
treehouse = 'Tree' + 'house'
email_greeting = '{} loves {}'.format('treehouse', 'name')

2 Answers

Seth Reece
Seth Reece
32,867 Points

Hi Mario,

You want to remove the quotes around your variable names. By using quotes you are passing a string inside of them to your placeholders instead of the variable.

Mario Miranda
Mario Miranda
7,829 Points

That worked. Thanks for your help.

Hello Mario

When you created the treehouse and name variables, you gave them the content. Now, when you are calling the created variables, you don't need to put them in quotes, as this will result in the variables being identified as strings, hence resulting in the error you're getting.

You need to have something like this:

name = 'Kelvine'
treehouse = 'Tree' + 'house'
email_greeting = '{} loves {}'.format(treehouse, name) 

Hope this helps

Mario Miranda
Mario Miranda
7,829 Points

That worked. Thanks for your help.