Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Explore a wealth of knowledge from professionals across various disciplines on our comprehensive Q&A platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.
Sagot :
Mark the other guy as brainliest, I'm just showing you what he meant.
I'm not sure if that's all that's wrong with your code, I'm just explaining what he meant.
Answer:
def_init(self, name = "", strengthpts = 0, alterego = "", villain "", powers = "", motto = ""):
# Create a new Superhero with a name and other attributes
self.name = name
self.strengthPts = strengthPts
self.alterego = alterego
self.powers = powers
self.motto = motto
self.villain = villain
def addStrengthPts(self, points):
# Adds points to the superhero's strength.
self.strengthPts = self.strengthPts + points
def addname(self):
if(self.name == "Dr.Cyber"):
print("My hero's name is Dr.cyber!")
elif(self.name == "Mr.cyber"):
print("My hero's name is Mr.cyber!")
elif(self.name == "Cyber Guy"):
print("My hero's name is Cyber Guy!")
else:
print("My hero doesn't have a name")
def addalterego(self):
if(self.alterego == "John Evergreen"):
print("Dr.Cyber's alter ego is John Evergreen")
elif(self.alterego == "John Silversmith"):
print("Dr.Cyber's alter ego is John Silversmith.")
elif(self.alterego == "Johnathen Grey"):
print("Dr.Cyber's alter ego is Johnathen Grey.")
else:
print("Dr.Cyber Does not have an alter ego")
def addpowers(self):
if(self.powers == "flight, super strength, code rewrighting, electronics control, psychic powers"):
print(fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants.He can control surrounding electronics to do what he wants. He can move objects with his mind.")
else:
print(Fly. He can rewrite the genetic code of any object around him. he can move objects with his mind.")
def addmotto(self):
if(self.motto == "error terminated!"):
print("rewritting the code!")
else:
print("error eliminated!")
def addvillain(self):
if(self.villain == "The Glitch"):
print("Dr.Cyber's Arch nemisis is The Glitch.")
elif(self.villain == "The Bug"):
print("Dr.Cyber's Arch nemisis is The Bug.")
else:
print("Dr.Cyber has no enemies!")
def main():
newhero = superhero("Dr.Cyber", "John Evergreen", "fly. He is super strong. He can rewrite the genetic code of any object around him to whatever he wants. He can control surrounding electronics to do what he wants. He can move objects with his mind.", "The Glitch", "error terminated!", "0")
print("My Superhero's name is " + newhero.name + ".")
print(newhero.name + "'s alter ego is " + newhero.alterego + ".")
print(newhero.name + " can " + newhero.powers + ".")
print(newhero.name + "'s arch nemisis is " + newhero.villain + ".")
print("when " + newhero.name + " fights " + newhero.villain + ", he lets out his famous motto " + newhero.motto + ".")
print(newhero.name + " defeated " + newhero.villain + ". Hooray!!!")
print(newhero.name + " gains 100 strengthpts.")
main()
We hope this information was helpful. Feel free to return anytime for more answers to your questions and concerns. Thanks for using our service. We're always here to provide accurate and up-to-date answers to all your queries. Find reliable answers at Westonci.ca. Visit us again for the latest updates and expert advice.