-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
48 lines (36 loc) · 704 Bytes
/
Copy pathmain.py
File metadata and controls
48 lines (36 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# main.py
from dog import Dog
from cat import Cat
from lion import Lion
from zookeeper import ZooKeeper
from zoo_manager import Zoo
# Create animals
dog = Dog("Bruno", 3, "Brown")
cat = Cat("Kitty", 2, "White")
lion = Lion("Simba", 5, "Yellow")
# Animal methods
dog.introduce()
dog.eat()
dog.make_sound()
print("-"*50)
cat.introduce()
cat.eat()
cat.make_sound()
print("-"*50)
lion.introduce()
lion.eat()
lion.make_sound()
# Create zookeeper
print("-"*50)
keeper = ZooKeeper("Raju")
keeper.feed_animal(dog)
keeper.feed_animal(cat)
keeper.put_to_sleep(lion)
# Create zoo
print("-"*50)
zoo = Zoo()
zoo.add_animal(dog)
zoo.add_animal(cat)
zoo.add_animal(lion)
print("-"*50)
zoo.show_all_animals()