Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help rewriting python codes. PYTHON 3 ONLY please :) Instructions below. Codes to be revised are also provided in screenshots below. Python 3 only.
Need help rewriting python codes. PYTHON 3 ONLY please :)
Instructions below.
Codes to be revised are also provided in screenshots below. Python 3 only. Thank you!
LAB13.PY
LAB13_TEST1
PETS.PY
THANK YOU SO MUCH!
Lab Exercises Microsoft Word lab1 3.docx https://www.ese msu.edu/-es https://www.ese msu.edu es https://www.c se.msu.edu-es Bobby x Secure https://www.cse.msu.edufcse231/Online/Labs/Lab13/lab13.pdf Apps For quick access, place your bookmarks here on the bookmarks bar. Import bookmarks now Microsoft Word-lab13.docx 1/2 2. Examine the file named "pets.py", which contains an outline of four classes to support the handling of pets within Python programs. You will Please note that class PetError" is a subclass of class "Exception" and is complete as-is. complete the remaining three classes as described below Class "Pet" (which is a subclass of class "Object") should include the following methods: Accepts three arguments: self, species (default None), and name (default ""). Stores species and name as data attributes. Raises PetError, if species is not one of the following (case insensitive): 'dog', 'cat, 'horse, gerbil', hamster, 'ferret nit Returns a string which depends on whether the pet is named or not. if named: "Species of: Xxx, named Yyy", where Xxx is the species data attribute and Yyy is the name data attribute, both in "title-case" (first letter upper case and rest lower casc hint: titlc) otherwise: "Species of: Xxx, unnamed". where Xxx is the species data attribute in "title-case" Class"Dog" (which is a subclass of class Pet") should include the following methods: init Accepts three arguments: self, name (default, and chases (default "Cats"). Uses the constructor for class "Pet" to store species ("Dog") and name as data attributes. Stores chases as a data attribute. Hint: check out how MassParticle calls the Particle initin Code Listing 12.11 Returns a string which depends on whether the dog is named or not. Hint: call the Pet class' _str_ (scc MassParticlc's_str_in Code Listing 12.11) str if named: "Species of Dog, named Yyy, chases zzz", where Yyy is the name data attribute (as above) and zzz is the chases data attribute. otherwise: "Species of: Dog, unnamed, chases zzz". where zzz is the chases data attribute. Lab Exercises Microsoft Word lab1 3.docx https://www.ese msu.edu/-es https://www.ese msu.edu es https://www.c se.msu.edu-es Bobby x Secure https://www.cse.msu.edufcse231/Online/Labs/Lab13/lab13.pdf Apps For quick access, place your bookmarks here on the bookmarks bar. Import bookmarks now Microsoft Word-lab13.docx 1/2 2. Examine the file named "pets.py", which contains an outline of four classes to support the handling of pets within Python programs. You will Please note that class PetError" is a subclass of class "Exception" and is complete as-is. complete the remaining three classes as described below Class "Pet" (which is a subclass of class "Object") should include the following methods: Accepts three arguments: self, species (default None), and name (default ""). Stores species and name as data attributes. Raises PetError, if species is not one of the following (case insensitive): 'dog', 'cat, 'horse, gerbil', hamster, 'ferret nit Returns a string which depends on whether the pet is named or not. if named: "Species of: Xxx, named Yyy", where Xxx is the species data attribute and Yyy is the name data attribute, both in "title-case" (first letter upper case and rest lower casc hint: titlc) otherwise: "Species of: Xxx, unnamed". where Xxx is the species data attribute in "title-case" Class"Dog" (which is a subclass of class Pet") should include the following methods: init Accepts three arguments: self, name (default, and chases (default "Cats"). Uses the constructor for class "Pet" to store species ("Dog") and name as data attributes. Stores chases as a data attribute. Hint: check out how MassParticle calls the Particle initin Code Listing 12.11 Returns a string which depends on whether the dog is named or not. Hint: call the Pet class' _str_ (scc MassParticlc's_str_in Code Listing 12.11) str if named: "Species of Dog, named Yyy, chases zzz", where Yyy is the name data attribute (as above) and zzz is the chases data attribute. otherwise: "Species of: Dog, unnamed, chases zzz". where zzz is the chases data attributeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started