Update page 'Day 7 homework - Sloejtes'
@@ -181,7 +181,8 @@ None
|
|||||||
```
|
```
|
||||||
**6. What happens when you try to call an abstract method, or access an abstract property in the base class?**
|
**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.
|
##### 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:**
|
**Example:**
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user