Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python problem Pet Class Create a class called Pet. A pet should take in string parameters name, species, color, age, and price. These values should
Python problem
Pet Class Create a class called Pet. A pet should take in string parameters name, species, color, age, and price. These values should then be assigned to attributes with the specified names. Age should be an integer and price should be a float. Name should be the only attribute capitalized. When displayed on the console, a pet should return the minimum required information to identify the pet, i.e. (name): (age. When printed, we should see all the information about a certain pet i.e. nameh is a (age year old (color (species). (name costs $(price). Pets should also be sortable. Pets should first be sorted by species alphabetically, then by name alphabetically if they are the same species. We also need to be able to determine when two pets are the same so that we don't end up with duplicates in our inventory. Consider two pets the same if they have all the same attributesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started