Question: Using Python Pet Class Create a class called Pet. A pet should take in string parameters name, species, color, age, and price. These values should
Using Python

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. (name) is a lage) 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 attributes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
