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 trialAkshaan Mazumdar
3,787 Pointswhat is the right solution for this?
Please help with the correct answer. Thanks!
def favorite_food(**dict):
return "Hi, I'm {} and I love to eat {}!".format(name,food)
1 Answer
Steven Parker
231,269 PointsThe function is designed to accept a dictionary argument, so you don't need the "splat" operator in the argument definition. But you may want to use it to provide values to the "format" function.
Akshaan Mazumdar
3,787 PointsAkshaan Mazumdar
3,787 Pointswhat does the correct thing look like?
Steven Parker
231,269 PointsSteven Parker
231,269 PointsI'd prefer to help you solve it yourself, I think you'll have a better learning experience that way.
Try applying the hint to your code. If you still haven't passed the challenge, post the revised code and I'll give another hint.
Akshaan Mazumdar
3,787 PointsAkshaan Mazumdar
3,787 PointsGot it finally thanks. Will need to practice this concept a lot :)
Do you know if i could see more examples of usage of packing and unpacking somewhere, or get to practice it?
Steven Parker
231,269 PointsSteven Parker
231,269 PointsI'd bet you could find some online resources, but it also sounds like a great suggestion for another "practice workshop".
You could make the suggestion directly to the staff as decribed on the Support page.