Answer:
Following are the method to this question:
def __init__(self, _name, _breed):#defining Constructor
""" Constructor """
self.name = _name#assigning value in name variable
self.breed = _breed#assigning value in breed variable
self.tricks = []#defining tricks an empty list
Explanation:
In the above code, a parameterized constructor is defined, that hold two-variable "name and breed" in its parameter, and another object self is created for storing the value.
Inside the constructor two-variable, and one empty list variable "tricks" is defined that hold value in the name and breed variable, and the next step an empty list is defined, that store its value.
Answer:
punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']
def strip_punctuation(strWord):
for charPunct in punctuation_chars:
strWord = strWord.replace(charPunct, "")
return strWord
Explanation:
The function is defined with a single argument.
A for loop is ran to check each character of the the word.
If a punction mark is present as a character in the word, it is removed.
The same word is returned but without the punctuation marks.
Answer: High cohesion
Explanation: Cohesion in general refers to make a couple of the functions or characteristics to share the functions and content . In the field of computer science , cohesion is the best characteristic that can be included in the design because it connect the various software so that they can share the responsibilities , function and can achieve better output through this. Thus high cohesion is the most preferred factor.
21%4 is 1.
21-4=17
17-4=13
13-4=9
9-4=5
5-4=1