Python Python Basics (2015) Python Data Types String Formatting

Hunter Wulffson
Hunter Wulffson
198 Points

It keeps saying "it looks like task one is no longer passing," and therefore isn't allowing me to continue.

Task one was to assign my name to the "name" variable. I am unable to continue with the .format task because of this.

strings.py
name = "Hunter"
subject = .format("Treehouse loves {}")

1 Answer

Kia Matthews
Kia Matthews
3,025 Points

You need to use the format method on the string. The bit that goes inside of format's () is the variable that you are filling in the {} with.

name = "Hunter"
subject = "Treehouse loves {}".format(name)