Question: 2 ) Make a class definition for a pet. It should have the following attributes name weight species Create an _ _ init _ _
Make a class definition for a pet. It should have the following attributes name weight species
Create an init function that has the self, and three arguments passed to it to initialize these attributes
Create the str function that has self as an argument that will print a class instance with the attributes Duck, Dog as Pet named Duck is lbs and is a Dog
Create two additional instances of the pet class and use print to output them.
Make a UML Class Diagram for the Pet Class, and show the two additional instances UML diagrams for the two instances created
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
