TASK1: To understand the meaning of classes we have to understand…

Question Answered step-by-step TASK1: To understand the meaning of classes we have to understand… TASK1: To understand the meaning of classes we have to understand the built-in __init__() function. All classes have a function called __init__(), which is always executed when the class is being initiated. Use the __init__() function to assign values to object properties, or other operations that are necessary to do when the object is being created:a. Create a class named Person, b. Use the __init__() function to assign values for name and age.c. Include a description method for Person. See the example of description method of Dogd. Instantiate two person objects representing you and your best friend and display their description (name and age)Task 2: Methods are functions defined inside the body of a class. They are used to define the behaviors of an object.class Parrot:       # instance attributes    def __init__(self, name, age):       self.name = name        self.age = age       # instance method    def sing(self, song):        return “{} sings {}”.format(self.name, song)     def dance(self):        return “{} is now dancing”.format(self.name) # instantiate the objectblu = Parrot(“Blu”, 10) # call our instance methodsprint(blu.sing(“‘Happy'”))print(blu.dance())  Look at the sample class Parrot.How many methods does it have?List the attributes in this class.What object can you notice in this code?What is the output of obj=Parrot()obj.nameobj.ageDescribe why you see the results as they are.  Task 3:Add a new attribute color to the class Parrot.Define the main method with the following requirements:Create a 5 new objects of type Parrot. Store the objects into a list. The list will have 5 objects. Using for loop, print the color of all the parrots in the list. (Create a display method inside class Parrot)Search for parrots that are Orange colored. (Create a search function)   Computer Science Engineering & Technology Python Programming BN 111 Share QuestionEmailCopy link Comments (0)