Question: Look at the following class definitions: class Vegetable: definit__(self, self.__vegtype def message (self): print (I'm a vegetable.) class Potato (Vegetable): definit__(self): vegtype): = vegtype Vegetable__init__(self,
Look at the following class definitions:
Given these class definitions, what will the following statements display?
v = Vegetable('veggie')
p = Potato()
v.message()
p.message()
class Vegetable: definit__(self, self.__vegtype def message (self): print ("I'm a vegetable.") class Potato (Vegetable): definit__(self): vegtype): = vegtype Vegetable__init__(self, 'potato') def message(self): print("I'm a potato.")
Step by Step Solution
3.32 Rating (155 Votes )
There are 3 Steps involved in it
Im a ... View full answer
Get step-by-step solutions from verified subject matter experts
