Question: using python Class Name: Livestock Instance Attributes name (str) Name of the Livestock. Should be all lowercase. price in (float) Price to buy the Livestock
Class Name: Livestock Instance Attributes name (str) Name of the Livestock. Should be all lowercase. price in (float) Price to buy the Livestock utilizations (str) Things the Livestock could be used for. More on the format below. Note: The format of utilizations will satisfy the following rules: Must be all lower case Utilizations should be separated by semicolons Utilizations should be in ascending alphabetical order Replace with the bool None if the Livestock has no potential utilization Example: "dairy fur;meat;wool" Description: Write a class called Livestock with the above attributes. Write the appropriate methods to accomplish the following tasks: Method #1 Initializes the attributes in the sequence listed above. Method #2 Makes the instances of the Livestock class sortable based on the number of potential utilizations. Method #3 Checks if two instances of the Livestock class are equal to each other. If a Livestock has the same name as another, then the two instances are equal to each other. Method #4 When a Livestock instance is called in the Python shell or printed, the following statement should be returned: "name, price_in" Example: "dog, 200.0" Make sure your output matches the format above exactly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
