Nov-15-2020, 03:37 AM
This is the test:
You need to change the orderPizza function to return a Pizza.
orderPizza()==Pizza('M',{'garlic', 'onion', 'mushroom'})orderPizza returns a string:
def orderPizza(): - snip - return f"Your pizza costs ${p.price()})"And this returns a Pizza object:
Pizza('M',{'garlic', 'onion', 'mushroom'})A Pizza object and a string will never be equal, so this test will always fail. This particular fail occurs when the Pizza.__eq__ metnod tries to compare the Pizza.size to str.size. str does not have an attribute named "size", so this throws an error.
You need to change the orderPizza function to return a Pizza.