Question: Using python write the code 1 class Person (object): def init _(self, name, age, gender): Construct a person object given their name, age and gender

Using python write the code

Using python write the code 1 class Person (object): def init _(self,

name, age, gender): "Construct a person object given their name, age and

1 class Person (object): def init _(self, name, age, gender): "Construct a person object given their name, age and gender Using Classes This problem relates to the pre-loaded class Person. Using the Person class, write a function print friend info(person) which Paraneters: name (str) The name of the person age(int): The age of the person gender (str): Either 'M or P for male or female 10 accepts a single argument, of type Person, and 12 13 14 15 16 17 18 19 20 21 self. name- name self._ageage self._gender-gender self. friendNone prints out their name prints out their age if the person has any friends, prints 'Friends with (name) Write a function create fry( which returns a Person instance representing Fry. Fry is 25 and his full name is 'Philip J. Fry def eq_(self, person): return str (self) str (person) def str (self): Write a function make_friends (person_one, person_two) which sets each argument as the friend of the other if self._gender M': elif self-gender =- 'F': else: titleMr' title Miss" titleMs 23 24 25 26 27 28 29 30 31 32 return title+self._name +'+str (self._age) def -repr-(self): return Person: str (self) def get name (self): 34 35 (str) Return the name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!