Skip to content

Commit

Permalink
dock test
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwsir committed Jun 6, 2017
1 parent dea750a commit a158909
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions newcodes/docktest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Cat:
def speak(self):
print("meow!")

class Dog:
def speak(self):
print("woof!")

class Bob:
def bow(self):
print("thank you, thank you!")
def speak(self):
print("hello, welcome to the neighborhood!")
def drive(self):
print("beep, beep!")

def command(pet):
pet.speak()

pets = [ Cat(), Dog(), Bob() ]

for pet in pets:
command(pet)

0 comments on commit a158909

Please sign in to comment.