Python Python Basics (2015) Python Data Types String Formatting

.format task 2 really need help

the question OK, now use .format() on the string "Treehouse loves {}" to put your name into the placeholder. Assign this to the variable subject (so start with subject =). You do not need to print() anything.

my answer is name = "juwan"

subject = "treehouse_loves {}"

subject = (subject.format("juwan")

strings.py
name = "juwan"
subject = "treehouse_loves {}"

subject = (subject.format("juwan")

name = "juwan" subject = "treehouse_loves {}".format('juwan')

I submitting this and its still wrong

1 Answer

Matt Hanson
MOD
Matt Hanson
Treehouse Moderator 17,516 Points

you don't need to re-assign 'subject', just call .format() on the end of the string inside 'subject', and pass in the variable that holds your name.