Question: A Verv Fishy Problem Previously in lecture, we discussed Python classes, which allow us to define our own data types that combine data (instance variables)

 A Verv Fishy Problem Previously in lecture, we discussed Python classes,which allow us to define our own data types that combine data

A Verv Fishy Problem Previously in lecture, we discussed Python classes, which allow us to define our own data types that combine data (instance variables) and operations (instance methods). In this lab, we wl use classes to create a virtual aquarium 1. Start by completing the Fish class, which will represent a single fish in our aquarium. Every Fish has four attributes, represented as instance variables: its name, its species, its color, and its weight in ounces. A Fish also has the following methods (with the following headers): .init_(self, name, species, color, weight) This method creates four new instance variables for the current Fish, and assigns them the values of the last four method parameters. Remember that an instance variable's name is always preceded by "self.", as in self.myData . repr_(self) This method returns a string representing the current Fish. This string should include a crude fish symbol ((Ted, yellow Goldfish)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!