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 trialReese Lynn
974 PointsWhat is going on?
I am getting an error, "Expected favorite_food({'name': 'Michelangelo', 'food': 'PIZZA'}) to return "Hi, I'm Michelangelo and I love to eat PIZZA!", but got "Hi, I'm Me and I love to eat qwerty!""
and when I used '''name="Michelangelo", food="PIZZA''', i got an error saying to use garfield and lasagna.
When I used garfield and lasagna, I got an error saying I have to use 'name': 'Michelangelo', 'food': 'PIZZA'.
WHY IS THIS?
Is this an error?
def favorite_food(dict):
return "Hi, I'm {name} and I love to eat {food}!".format(name="Me", food="qwerty")
2 Answers
Duc Bui
14,546 Pointsdef favorite_food(dict):
return "Hi, I'm {name} and I love to eat {food}!".format(**dict)
Jonathan Grieve
Treehouse Moderator 91,253 PointsIt looks like you're passing in the wrong values to the dictionary. The Error is telling you that it's expecting particular values to pass the challenge, Michaelangelo, and PIZZA. Try putting those in and see if that passes! :-)
Reese Lynn
974 PointsThanks!
Reese Lynn
974 PointsReese Lynn
974 PointsThank You!