We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dea750a commit a158909Copy full SHA for a158909
1 file changed
newcodes/docktest.py
@@ -0,0 +1,23 @@
1
+class Cat:
2
+ def speak(self):
3
+ print("meow!")
4
+
5
+class Dog:
6
7
+ print("woof!")
8
9
+class Bob:
10
+ def bow(self):
11
+ print("thank you, thank you!")
12
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