You will need to create two classes. The first class is going to be the parent class and is going to be on Pets. • should have an init method that requires name, age, and color parameters to be set. • should have a default value for the attribute pet_type that sets it to 'dog. • should have a method named desc_type to print the pet_type • should have a method named desc_pet to print the name, age and color in a sentence. Create 3 different pets with different names, ages, and colors. • The first pet should use the default pet_type. • The second pet should be a pet_type of cat. • The third pet should be a pet_type of hamster. Use desc_pet to print each pets name, age and color and the method desc_type to print each pet_type. Change the second pet's name. Use the method desc_pet to print the second pet's name. Now create a sub class of Pets that is named Birds. • Use the parent's _init_() method. • Create a new default attribute only for Bird's size. • Create a new method desc_size to print out the bird's size. • Create two instances of bird by setting the birds attribute for name, age, color. • Print out the new instances attributes including the new desc_size default by using the desc_size method. • Override the parent method of desc_type to print out the type as being a bird.
You will need to create two classes. The first class is going to be the parent class and is going to be on Pets. • should have an init method that requires name, age, and color parameters to be set. • should have a default value for the attribute pet_type that sets it to 'dog. • should have a method named desc_type to print the pet_type • should have a method named desc_pet to print the name, age and color in a sentence. Create 3 different pets with different names, ages, and colors. • The first pet should use the default pet_type. • The second pet should be a pet_type of cat. • The third pet should be a pet_type of hamster. Use desc_pet to print each pets name, age and color and the method desc_type to print each pet_type. Change the second pet's name. Use the method desc_pet to print the second pet's name. Now create a sub class of Pets that is named Birds. • Use the parent's _init_() method. • Create a new default attribute only for Bird's size. • Create a new method desc_size to print out the bird's size. • Create two instances of bird by setting the birds attribute for name, age, color. • Print out the new instances attributes including the new desc_size default by using the desc_size method. • Override the parent method of desc_type to print out the type as being a bird.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
This is Phython

Transcribed Image Text:You will need to create two classes. The first class is going to be the parent class and is going to be on Pets.
• should have an init method that requires name, age, and color parameters to be set.
• should have a default value for the attribute pet_type that sets it to 'dog!.
• should have a method named desc_type to print the pet_type
• should have a method named desc_pet to print the name, age and color in a sentence.
Create 3 different pets with different names, ages, and colors.
• The first pet should use the default pet_type.
• The second pet should be a pet_type of cat.
• The third pet should be a pet_type of hamster.
Use desc_pet to print each pets name, age and color and the method desc_type to print each pet_type.
Change the second pet's name.
Use the method desc_pet to print the second pet's name.
Now create a sub class of Pets that is named Birds.
• Use the parent's _init_0 method.
• Create a new default attribute only for Bird's size.
• Create a new method desc_size to print out the bird's size.
• Create two instances of bird by setting the birds attribute for name, age, color.
• Print out the new instances attributes including the new desc_size default by using the desc_size method.
• Override the parent method of desc_type to print out the type as being a bird.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY