Question: class Spell: def __init__(self, incantation, name): self.name = name self.incantation = incantation def_str_(self): return self.name +''+ self.incantation + ' ' + self.get_description() def get_description(self): return

 class Spell: def __init__(self, incantation, name): self.name = name self.incantation =
incantation def_str_(self): return self.name +''+ self.incantation + ' ' + self.get_description() def

class Spell: def __init__(self, incantation, name): self.name = name self.incantation = incantation def_str_(self): return self.name +''+ self.incantation + ' ' + self.get_description() def get_description(self): return 'No description' def execute(self): print self.incantation class Accio(Spell): def __init__(self): Spell._init__(self, 'Accio', 'Summoning Charm') class Confundo(Spell): def __init__(self): Spell._init__(self, 'Confundo', 'Confundus Charm') def get_description(self): return 'Causes the victim to become confused and befuddled! def study_spell(spell): print spell spell = Accio() spell.execute() study_spell(spell) study_spell(Confundo()) Answer the following questions: 1. What are the parent and child classes here? 2. What are the base and sub-classes? 3. What is the output from this code? Try without running if you can 4. When study_spell(Confundo()) executes...what get_description method gets called and why? 5. The statement print Accio() needs to print 'This charm summons an object to the caster, potentially over a significant distance')? Write down the code that we need to add and/or change

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!