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 trialMario Miranda
7,829 PointsStuck on Python basics question.
Getting stuck on this Python basics question. Not sure where my mistake is.
name = 'Mario'
treehouse = 'Tree' + 'house'
email_greeting = '{} loves {}'.format('treehouse', 'name')
2 Answers
Seth Reece
32,867 PointsHi 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.
MUZ141095 Kelvin Chawora
9,348 PointsHello 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
7,829 PointsThat worked. Thanks for your help.
Mario Miranda
7,829 PointsMario Miranda
7,829 PointsThat worked. Thanks for your help.