File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 22
33# Inheritance
44
5- A class can inherit attributes from an other class called a super or parent class,
5+ A class can inherit attributes from another class called a super or parent class,
66the former is called the child class
77
8- Compare this to fruit.Apples and strawberries are both fruits and have
9- the same basic prequisites for a typical fruit but each their own characteristics
8+ Compare this to fruit. Apples and strawberries are both fruits and have
9+ the same basic prerequisites for a typical fruit but each their own characteristics
1010In this situation the parent class would be fruit and the child classes would be
1111the apple and strawberry classes
1212
@@ -21,7 +21,7 @@ class class_name (super_class_name):
2121
2222### Time for an example
2323
24- So lets see an example based on the earlier one of fruits
24+ So let's see an example based on the earlier one of fruits
2525
2626``` python
2727class fruit ():
@@ -44,7 +44,7 @@ class Strawberry(fruit):
4444
4545As before Strawberry and Apple inherit from fruit which means all of their
4646objects will have the attributes of the class fruit but why should you believe me?
47- Lets test it out by creating objects and seeing what happens
47+ Let's test it out by creating objects and seeing what happens
4848
4949``` python
5050a = Apple()
You can’t perform that action at this time.
0 commit comments