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

Python Python Collections (2016, retired 2019) Dictionaries String Formatting with Dictionaries

when i run on my local python idle it gives me the output requested but for some reason i keep on getting a bummer messa

please find where i am getting it wron

string_factory.py
def favorite_food(name="None",food="None"):
    return "Hi, I'm {name} and I love to eat {food}!".format(name="Michaelangelo",food="PIZZA")

print(favorite_food(**{"name":"garfield","food":"la sagne"}))

1 Answer

The challenge says "accepts a dictionary as an argument. Your function should unpack that dictionary and pass it to the format method as keywords, then return the resulting string." Your function accepts two variables, not a dictionary.

(In the future, please paste in the challenge text so people don't have to go to it to see what you're talking about. If the challenge is not the first step, people won't be able to see it without doing the other steps first.)