Question: python We also need an aquarium to hold our fish. To do this, we need to define a second class, named Aquarium. An Aquarium has



python
We also need an aquarium to hold our fish. To do this, we need to define a second class, named Aquarium. An Aquarium has two instance variables: a list of Fish instances, and an integer representing the water capacity of the tank in gallons (each Fish requires 1 gallon of water). An Aquarium also has the following methods init_ (self, capacity) This method creates a new instance variable that is an empty list; this list will eventually be filled with F1sh objects. It also assigns its second parameter to a new instance variable capacity in gallons. representing the Aquarium's total repr_(self) This method returns a single string that contains the string representations of the Fish in the Aquarium's internal list, in the same order that they appear in that list. Insert tab ("\t") and newline (" ") characters to ensure that, when this string is displayed, no more than two Fish are printed per line (if there are an odd number like of fish, the last one will be printed on a line by itself). For example, a call to this method might return a string "(Bi11, red Gourami)\t (Ted, yellow Goldfish)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
