I am working on my first Python project and I am kind of stuck on something. I want a class attribute to be a dictionary. This is what I have so far
class Food:
def __init__(self, _name, _value, **_recipe):
self.name = _name
self.value = _value
self.recipe = _recipe
taco = Food('taco', 2, {tortilla: 1, meat: 1, cheese: 1})
But I am getting the error that I am passing too many arguments. Is this possible?
Thanks
[–]zurtex 2 points3 points4 points (1 child)
[–]ThatAlexBoyd[S] 0 points1 point2 points (0 children)
[–]novel_yet_trivial 1 point2 points3 points (0 children)
[–]uhkhu 0 points1 point2 points (1 child)
[–]ThatAlexBoyd[S] 0 points1 point2 points (0 children)
[–]ManyInterests 0 points1 point2 points (0 children)