-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnine.py
More file actions
51 lines (38 loc) · 1.06 KB
/
nine.py
File metadata and controls
51 lines (38 loc) · 1.06 KB
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
class Dog:
name = "Dog"
_tail = 1
_legs = 4
_ears = 2
_bark = "roof roof roof"
_color = "black and white"
_waggingTail = "wagging tail"
_age = 0;
def __init__(self, bark, color):
self._bark = bark
self._color = color
def set_bark(self, bark):
self._bark = bark
def get_tail_number(self):
return self._tail
def make_noise(self):
return self._bark
def wag_tail(self):
return self._waggingTail
def get_dog_color(self):
return self._color
def set_age(self, age):
self._age = age
def calcuate_human_age(self):
currentAge = self._age
dogAgeMultipler = 15
return currentAge * dogAgeMultipler
dog = Dog("roof", "blue and black")
print(dog.make_noise())
prettyDog = Dog("arhooooooo", "brown and grey")
print(prettyDog.make_noise())
prettyDog.set_bark("roof roof roof")
print(prettyDog.make_noise())
prettyDog.set_age(3)
print("dog age " + str(prettyDog.calcuate_human_age()))
normal_dog = Dog()
print(normal_dog.make_noise())