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

Not sure what the challenge is asking in the Python Basics Stage 2 Ins & Outs Challenge task 3

I'm not quite sure what the challenge is asking to do. Challenge task 3 of 3 Finally, create a new variable named email_greeting that puts treehouse and name into "X loves Y" so X is treehouse and Y is name.

1 Answer

Stone Preston
Stone Preston
42,016 Points

It wants the email_greeting variables value to be "[value of treehouse variable here] loves [value of name variable here]"

Here are some hints:

you can do this using concatenation

     string_four = some_variable + " a string " + some_other_variable

notice that you need to be mindful of spaces before and after your strings when concatenating.

you can also use the format function

    string four = "this is a string {} using the {} format function".format(some_variable, string_other_variable)

the above code will insert the values of some_variable and some_other_variable where the {} are located. So if the values of some_variable are "first string" and "second string" the above code will output this is a string first string using the second string format function"