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

Adam Cameron
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Adam Cameron
Python Web Development Techdegree Graduate 16,731 Points

Packing/unpacking challenge - Don't understand the task

I don't think I understand what's wanted of me here, can someone elaborate? It makes sense up to the last sentence, and that's where they lose me. Am I even on the right track with my code?

string_factory.py
# Example:
# values = [{"name": "Michelangelo", "food": "PIZZA"}, {"name": "Garfield", "food": "lasagna"}]
# string_factory(values)
# ["Hi, I'm Michelangelo and I love to eat PIZZA!", "Hi, I'm Garfield and I love to eat lasagna!"]

template = "Hi, I'm {name} and I love to eat {food}!"

def string_factory(dict_list):
    print(template.format(dict_list))

string_factory(**{"name": "Adam", "food": "Pizza"})

I'm going to reference you to this answer that I gave a couple of weeks ago that might provide a bit of insight and also has a link to information on args/kwargs. If you still need a bit more help, feel free to let me know and I'll try to expand on the areas you're struggling with.