我的FLVS类的类和方法代码有问题

2024-09-27 00:16:04 发布

您现在位置:Python中文网/ 问答频道 /正文

class Superhero:
    def __init__(self, name = "", specialability = "", adversary = "", impotence = ""):
         # Create a new superhero and give her characteristics.
        self.name = name
        self.specialability = specialability
        self.adversary = adversary
        self.impotence = impotence

def main():
    newSuperhero = Superhero("Memphis May", "Teleportation", "Mind     control", "Mathematics", "Homework")
    print("Allow me to introduce you to my superhero, her name is " + newSuperhero.name)
    print("She is extremely gifted and she was blessed with the following specialability's: " + newSuperhero.specialability)
    print("Yet, she constantly faces her greatest adversary, " +  newSuperhero.adversary)
    print("Unfortunately, her biggest impotence is " + newSuperhero.impotence)

main()

Tags: andtonameselfismaindefprint
1条回答
网友
1楼 · 发布于 2024-09-27 00:16:04

我觉得你现在的问题是争论太多了,你想做的是做数学作业,我相信。你知道吗

第十行newSuperhero = Superhero("Memphis May", "Teleportation", "Mind control", "Mathematics", "Homework")你所拥有的是什么导致了你的问题。更改为:

newSuperhero = Superhero("Memphis May", "Teleportation", "Mind control", "Mathematics homework.")应该可以解决您的问题。你知道吗

相关问题 更多 >

    热门问题