[Python #9] update e42.py
This commit is contained in:
parent
9e67105185
commit
bad94148be
1 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
## Animal is-a object (yes, sort of confusing) look at the extra credit
|
## Animal is-a object (yes, sort of confusing) look at the extra credit
|
||||||
class Animal(object):
|
class Animal(object):
|
||||||
pass
|
def something(self):
|
||||||
|
print("base")
|
||||||
|
|
||||||
|
|
||||||
## Dog is-a Animal
|
## Dog is-a Animal
|
||||||
|
@ -37,7 +38,8 @@ class Employee(Person):
|
||||||
|
|
||||||
## Fish is-a object
|
## Fish is-a object
|
||||||
class Fish(object):
|
class Fish(object):
|
||||||
pass
|
def __init__(self):
|
||||||
|
print("Base Fish")
|
||||||
|
|
||||||
|
|
||||||
## Salmon is-a Fish
|
## Salmon is-a Fish
|
||||||
|
@ -52,7 +54,7 @@ class Halibut(Fish):
|
||||||
|
|
||||||
## rover is-a Dog
|
## rover is-a Dog
|
||||||
rover = Dog("Rover")
|
rover = Dog("Rover")
|
||||||
|
rover.something()
|
||||||
## satan is-a Cat
|
## satan is-a Cat
|
||||||
satan = Cat("Satan")
|
satan = Cat("Satan")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue