Commit f95d9b8f by BellCodeEditor

save project

parent 052e7bce
Showing with 22 additions and 7 deletions
class Hero: self.attack = self.attack + 4
def __init__(self): def __init__(self):
self.level = 1 self.level = 1
self.name = name self.name = name
...@@ -10,6 +11,12 @@ chenshi = Hero("chensi",10000,10000) ...@@ -10,6 +11,12 @@ chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack)) print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack)) print(yuyi.name+"攻击力:"+str(yuyi.attack))
yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000)
print(chenshi.name+"攻击力是:"+str(chenshi.attack))
print(yuyi.name+"攻击力:"+str(yuyi.attack))
yuyi = Hero("雨衣",10000,10000) yuyi = Hero("雨衣",10000,10000)
chenshi = Hero("chensi",10000,10000) chenshi = Hero("chensi",10000,10000)
......
class Hero: c self.attack = self.attack + 4
def __init__(self): self.attack = self.attack + 4
self.level = 1 self.attack = self.attack + 4
self.name = name self.attack = self.attack + 4
self.hp = hp self.attack = self.attack + 4
self.attack = a v
v
v
v
v
v
vvvvvvvv
v
class Hero: class Hero:
def __init__(self): def __init__(self):
self.level = 1 self.level = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment