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

Task two, is no longer passing in Python concatenates name = "subject" NameError: name 'subject' is not defined

How do I correct this error because each time I try it on Workspace it works fine but not in the quiz?

jonlunsford
jonlunsford
16,746 Points

Aaron: Can you provide your code for this code challenge?

3 Answers

jonlunsford
jonlunsford
16,746 Points

Looks like you should have 2 variables: “name” and “subject”. Name should be a string of your name, and subject will be a concatenation of “Treehouse loves “ and the name variable.

Example: name = “Aaron” subject = “Treehouse loves “ + name

Make a new variable named subject that concatenates (uses the + sign) the string "Treehouse loves" and your name variable.

name = "Aaron" name = "subject" status_message = "subject " + "Treehouse loves " + "Aaron"

Thank you Jonlunsford for adjusting my thinking on the matter I see now where I went wrong.

Thank you,

Aaron Mc