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
Crazy Bachan
43 PointsHow do we write a Python code of .format
name = Aflo Pop subject = name.format("Treehouse Loves"{})
2 Answers
Steven Parker
243,318 PointsYou have your template and argument reversed. The template goes in front of ".format", and the argument goes inside the parentheses.
Also, be careful to keep the template as provided in the instructions, with the braces inside the quotes with the other text. And it looks like you still need quotes around string being assigned to "name".
Aayush Mitra
24,904 PointsHere is a quick example of .format:
name = "Aayush {}"
full_name = name.format("Mitra")
print(full_name)
Hope this helps!
Thanks! :)
Steven Parker
243,318 PointsThat might work in an IDE but it's not really what the challenge instructions say to do.
Aayush Mitra
24,904 PointsOkay, sorry about that.
I have put an answer to the actual challenge.
Sorry once again.
Could you please tell me what challenge he is on Steven? It did not have the link saying "veiw challenge".
Thanks! :)
Steven Parker
243,318 PointsNo, that button is not present. I suspect this question was not created with the "get help" button.