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 trialPhilip Lewis
200 PointsHaving some trouble with the format method
can't figure out what it is that I'm doing wrong here.
name = "Philip"
subject = "Treehouse loves {}"
print("Treehouse loves".function(name))
I've also tried putting (Philip) instead of (name) after the function
2 Answers
Alexander Davison
65,469 PointsThe challenge didn't ask you to print anything.
If you get rid of the print
statement, you should end up like this:
name = 'Philip'
subject = 'Treehouse loves {}'.format(name)
Good luck! ~alex
Philip Lewis
200 PointsOh man lol I'm usually a pretty good listener but I guess I slipped on this one. Thank you so much. lemme go try this now. I'm sure it will work.
Alexander Davison
65,469 PointsNo problem :)
Philip Lewis
200 PointsWow ok so I finally got it and I don't understand what it is I did differently this time. Was the same thing i had been doing the whole time but here's what I did.
name = "Philip"
subject = "Treehouse loves {}".format(name)
Thanks for the help man. I appreciate it.
Alexander Davison
65,469 PointsNo problem (again)! :)
I'm happy to help.
Philip Lewis
200 PointsPhilip Lewis
200 Pointsoops I meant to put format instead of function in the code