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 trialJoseph Kumar
1,930 PointsIs this placeholder format incorrect: name = "Joseph" subject = "Treehouse loves {}" print(subject.format(name))
The task was to get hold of my name in the placeholder and ensure that the output is "Treehouse loves Joseph"
name = "Joseph"
subject = "Treehouse loves {}"
print(subject.format(name))
2 Answers
Andrew Rady
20,880 PointsHey Joseph,
The code challenge is looking for you to use the .format on the subject variable and then print just the variable.
Here is what my code looks like
name = 'Andy'
subject = 'Treehouse loves {}'.format(name)
print(subject)
Joseph Kumar
1,930 PointsThanks for the correction Andrew Rady. :)
Andrew Rady
20,880 Pointsanytime :)
Andrew Rady
20,880 PointsAndrew Rady
20,880 PointsHey Joseph,
The code challenge is looking for you to use the .format on the subject variable and then print just the variable.
Here is what my code looks like