diff --git a/Day 7 homework - Sloejtes.md b/Day 7 homework - Sloejtes.md index 8739533..3a56b6a 100644 --- a/Day 7 homework - Sloejtes.md +++ b/Day 7 homework - Sloejtes.md @@ -181,3 +181,17 @@ None ``` **6. What happens when you try to call an abstract method, or access an abstract property in the base class?** +##### Answer: When trying to call an abstract method or access an abstract property in the base class, we will get a TypeError with a message indicating that the abstract method or property was not implemented in the subclass because abstract methods and properties in Python are meant to be overridden and implemented in subclasses. They serve as a sort of blueprint for what methods and properties a subclass should have, without dictating the implementation details. + +**Example:** +``` +v = Vehicle() +``` +###### Output: +``` +TypeError Traceback (most recent call last) +Input In [50], in () +----> 1 v = Vehicle() + +TypeError: Can't instantiate abstract class Vehicle with abstract methods num_wheels, start +``` \ No newline at end of file