Question
given is a code snippet in python : import sys class mammal : def _init_(self) : self.legs = 4 self.face = (2,2,1) def speak (self)
given is a code snippet in python :
import sys
class mammal :
def _init_(self) :
self.legs = 4
self.face = (2,2,1)
def speak (self) :
pass
class dog (mammal) :
def speak (self) :
print "I bark"
class cat (mammal) :
def speak (self) :
print "I purr"
class pig (mammal) :
def speak (self) :
print "I grunt"
class tiger (cat) :
def speak (self) :
print "I roar"
class man (dog,cat,pig,tiger) :
pass
___________________________
Question - modify the code such that man will have 2 ears, 2 eyes, 1 nose, 2 legs, 2 hands and is able to speak like other mammals as well as should talk, i.e, Man should speak : I bark I purr I grunt I roar I even talk.
PLEASE INCLUDE ALL THE STEPS AND EXPLAIN THE ANSWER IN DETAIL
Step 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