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 (2015) Python Data Types String concatenation

It looks like Task 1 is no longer passing. why do i get this error message

why do i get this error message

strings.py
Subject = "Treehouse loves " + name

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're getting this error message for two reasons. The first step asks that you define a variable named name and set it equal to your name, which you apparently did just fine. But then you removed that line. Take a look at the informational tip in the challenge:

Important: In each task of this code challenge, the code you write should be added to the code from the previous task.

Another reason for getting this message is because of a syntax error, which is also the case here. Because you've removed the line that defines name, when you try to concatenate name onto the string literal, it is no longer defined and thus, a syntax error occurs.

Finally, the variable should be named subject and not Subject. Note the capitalization here. Challenges are extremely strict. Instructions must be followed to the letter. This includes capitalization, punctuation, spelling, and even spacing!

Hope this helps! :sparkles: