-
Notifications
You must be signed in to change notification settings - Fork 0
/
flora.py
95 lines (64 loc) · 1.58 KB
/
flora.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class Birds:
def __init__(self, poroda, age):
self.poroda = poroda
self.age = age
def eat(self):
return f'I am eat worms'
def swim(self):
return f'I cannot swim'
def fly(self):
return f'I cannot fly'
class Mammals:
def __init__(self, poroda, age):
self.poroda = poroda
self.age = age
def eat(self):
return f'I am eat grass'
def swim(self):
return f'I cannot swim'
def fly(self):
return f'I cannot fly'
class Fishes:
def __init__(self, poroda, age):
self.poroda = poroda
self.age = age
def eat(self):
return f'I am eat worms'
def swim(self):
return f'I can swim'
def fly(self):
return f'I cannot fly'
class Falcon(Birds):
def eat(self):
return f'I am eat meat'
class Penquin(Birds):
def eat(self):
return f'I am eat fish'
def swim(self):
return f'I can swim'
def fly(self):
return f'I cannot fly'
class Trout(Fishes):
def eat(self):
return f'I am eat korm'
class Whale(Fishes):
def eat(self):
return f'I am eat planktons'
def swim(self):
return f'I can swim'
ping = Penquin('royal', 12)
print(ping.eat())
print(ping.swim())
print(ping.fly())
# falc = Falcon('орёл', 1)
# print(ping.eat())
# print(ping.swim())
# print(ping.fly())
# forel = Trout('балык', 2)
# print(ping.eat())
# print(ping.swim())
# print(ping.fly())
# kit = Whale('чон балык', 3)
# print(ping.eat())
# print(ping.swim())
# print(ping.fly())