[Python #9] update e42.py

This commit is contained in:
kjg 2020-06-12 23:10:56 +09:00
parent 9e67105185
commit bad94148be
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
## Animal is-a object (yes, sort of confusing) look at the extra credit
class Animal(object):
pass
def something(self):
print("base")
## Dog is-a Animal
@ -37,7 +38,8 @@ class Employee(Person):
## Fish is-a object
class Fish(object):
pass
def __init__(self):
print("Base Fish")
## Salmon is-a Fish
@ -52,7 +54,7 @@ class Halibut(Fish):
## rover is-a Dog
rover = Dog("Rover")
rover.something()
## satan is-a Cat
satan = Cat("Satan")