Question: Solve in Python. Need within 1hour. Question: 3 Implement the design of the SpidermanOne and SpidermanThree class derived from GenericSpiderman class so that the following
Solve in Python. Need within 1hour.
Question: 3 Implement the design of the SpidermanOne and SpidermanThree class derived from GenericSpiderman class so that the following code generates the output below: class GenericSpiderman: def __init__(self, name = None): self.name = name print('Welcome to Spiderverse!') if self.name == None: print('Who is your favourite Spiderman?') else: print(f'{self.name} is your favourite Spiderman!') def hasSpiderTingle(self): print('All spiderman has spider sense.') def shootWeb(self, hasWebshooter = False): s = 'All Spiderman can shoot web. ' if hasWebshooter == False: s += 'Spiderman does not need a webshooter.' else: s += 'Spiderman needs a webshooter.' return s #Write your code here #------------------------------------------------------------------------------------- print('1.============================') s = GenericSpiderman() print('2.============================') s.hasSpiderTingle() print('3.============================') s1 = SpidermanOne('Toby Maguire', 'Not Avenger') print('4.============================') print(s1) print('5.=============================') print(s1.shootWeb(False)) print('6.=============================') s1.hasSpiderTingle() print('7.=============================') s2 = SpidermanThree('Tom Holland') print('8.=============================') print(s2) print('9.=============================') print(s2.hasSpiderTingle()) print('10.============================') print(s2.shootWeb(True)) print('11.============================') print(s2) print('12.============================') SpidermanOne.enemyList = ['Green Goblin','Doctor Octopus','Sandman'] print(SpidermanOne.enemyList) print('13.============================') s1.fightEnemy(['Doctor Octopus', 'Rhino', 'Venom']) print('14.===========================') SpidermanThree.enemyList = ['Mysterio','The Vulture'] print(SpidermanThree.enemyList) print('15.===========================') s2.fightEnemy(['Doctor Octopus', 'Mysterio']) OUTPUT: 1.============================ Welcome to Spiderverse! Who is your favourite Spiderman? 2.============================ All spiderman has spider sense. 3.============================ Welcome to Spiderverse! Toby Maguire is your favourite Spiderman! 4.============================ Toby Maguire's spiderman is not a member of Avengers. 5.============================= All Spiderman can shoot web. Spiderman does not need a webshooter. Toby Maguire's spiderman doesn't have a web-shooter. 6.============================= All spiderman has spider sense. 7.============================= Welcome to Spiderverse! Tom Holland is your favourite Spiderman! 8.============================= Tom Holland's spiderman is a member of Avengers. 9.============================= All spiderman has spider sense. Spider sense is now called "Peter Tingle" 10.============================ All Spiderman can shoot web. Spiderman needs a webshooter. Tom Holland's spiderman has a web-shooter. 11.============================ Tom Holland's spiderman is a member of Avengers. 12.============================ ['Green Goblin', 'Doctor Octopus', 'Sandman'] 13.============================ Toby Maguire's spiderman can fight Doctor Octopus. Toby Maguire's spiderman cannot fight Rhino. Toby Maguire's spiderman cannot fight Venom. 14.=========================== ['Mysterio', 'The Vulture'] 15.=========================== Tom Holland's spiderman cannot fight Doctor Octopus. Tom Holland's spiderman can fight Mysterio.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
