Skip to content

Commit a158909

Browse files
committed
dock test
1 parent dea750a commit a158909

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

newcodes/docktest.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class Cat:
2+
def speak(self):
3+
print("meow!")
4+
5+
class Dog:
6+
def speak(self):
7+
print("woof!")
8+
9+
class Bob:
10+
def bow(self):
11+
print("thank you, thank you!")
12+
def speak(self):
13+
print("hello, welcome to the neighborhood!")
14+
def drive(self):
15+
print("beep, beep!")
16+
17+
def command(pet):
18+
pet.speak()
19+
20+
pets = [ Cat(), Dog(), Bob() ]
21+
22+
for pet in pets:
23+
command(pet)

0 commit comments

Comments
 (0)