2017-04-06 10 views
1
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() 
+1

あなたの問題は何ですか? –

+0

質問は何ですか? –

+0

書式を修正してください。一番簡単なのは、テキストエディタから直接コピー&ペーストしてから、そのテキストをハイライトしてcltr-kを押すことです。 –

答えて

0

私は問題が多すぎると思います。

10行目newSuperhero = Superhero("Memphis May", "Teleportation", "Mind control", "Mathematics", "Homework")あなたの問題の原因は何ですか。変更すると、

newSuperhero = Superhero("Memphis May", "Teleportation", "Mind control", "Mathematics homework.")が問題を解決するはずです。

+1

私の先生は、メインメソッド以外の関数を使用し、メイン方法。彼女によると、私はそれをやっていない。私は彼女の反応が何を意味するのかも知らない。 – Katherine

関連する問題