Skip to content

Commit 5344d15

Browse files
authored
Update README.md
1 parent 74207fb commit 5344d15

File tree

1 file changed

+2
-2
lines changed
  • exercises/043-inheritance_and_polymorphism

1 file changed

+2
-2
lines changed

exercises/043-inheritance_and_polymorphism/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ high_school_student.study(4) # This method has been slightly modified and now i
1919

2020
Assuming that the `Student` class from the previous exercise is coded just above this `HighSchoolStudent` class, to inherit its methods and attributes, we simply include the name of the class we want to inherit from (the parent class) inside the parentheses of the child class (`HighSchoolStudent`). As you can see, we can now use the `introduce` method from the `Student` class without having to code it again, making our code more efficient. The same applies to attributes; we don't need to redefine them.
2121

22-
Additionally, we have the flexibility to add new methods exclusively for this class or even override an inherited method if needed, as demonstrated in the `study` method which is slightly modified from the `Student` method; this is called **polymorphism**.
22+
Additionally, we have the flexibility to add new methods exclusively for this class or even override an inherited method if needed, as demonstrated in the `study` method, which is slightly modified from the `Student` method; this is called **polymorphism**.
2323

2424
## 📝 Instructions:
2525

@@ -43,4 +43,4 @@ Additionally, we have the flexibility to add new methods exclusively for this cl
4343

4444
## 💡 Hint:
4545

46-
+ You may have noticed the use of a new method `super()` which is necessary for inheriting from a parent class. Take a look at where it is positioned and have a read about it: [Understanding Python's super()](https://realpython.com/python-super/).
46+
+ You may have noticed the use of a new method `super()` which is necessary for inheriting from a parent class. Take a look at where it is positioned and have a read about it: [Understanding Python's super()](https://realpython.com/python-super/).

0 commit comments

Comments
 (0)