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 trialKade Carlson
5,928 PointsNot sure what I did wrong
Please check my code and explain what I am doing wrong. It seems like everything is correct and I am doing exactly what we did in the lesson
name = "Kade"
subject = "Treehouse loves {} "
print(subject.format(name))
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHey Kade,
While, technically, the code above is correct, it is not what the challenge asked you to do. Challenges are very specific and picky, so it's important to follow the instructions exactly.
The challenge did not ask you to print anything, so that line needs to be deleted. It only asked you to assign the requested string to the subject
variable. Also, you have a trailing space in the string that needs to be deleted.
So, once you move all the pieces around and deleted what wasn't asked for...
name = "Kade"
subject = "Treehouse loves {}".format(name)
Your code will pass. :)
Keep Coding!
Kade Carlson
5,928 PointsKade Carlson
5,928 PointsOh ok, thank you very much!