Question: Python: You will create a simple class pet which will contain: -Type of pet (a string) -Name of pet(a string) -Age of pet (an int)
Python: You will create a simple class pet which will contain:
-Type of pet (a string)
-Name of pet(a string)
-Age of pet (an int)
-Tricks (a list of tricks the pet can perform)
-Fleas of pet (an int)
All of these data attributes except for the last one (fleas) will be unique to each object. The fleas will be common to all pets, as they like to travel.
In your main part of your program, you will create 3 pets with various attributes (type, name, age) which you can pick. Each pet can perform at least 2 tricks and a random number of fleas between 0 and 10. They can add new tricks to their arsenal.
You will print the information for each of the pet, and the total number of fleas the households pets own.
Requirements: You will have three or more methods in your class (including the constructor), one of which will return a value You will use the random library
Also: Add a class called Person who owns a pet, has an age, a name. They can also take some training. Every time they train, their pet learns a new trick.
Create a person ("Jane", 42), who owns a dog ("Spot", 3 years old) who knows how to sit and stay.
Jane takes a "walk on a leash" training. Print the information for Spot before and after Jane takes her training.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
