The __repr__
function does not work in the following code:
class Minibar:
def __init__(self, drinks, snacks):
self.drinks=drinks
self.snacks= snacks
self.bill=0
def __repr__(self):
return "The minibar contains the drinks: " + list(str(self.drinks)) + "And the snacks: " + list(str(self.snacks)) + "The bill for the minibar is:" + self.bill**
m = Minibar({'coke': 10, 'lemonade': 7}, {'bamba': 8, 'mars': 12})
print(m)