Commit 526f4f58 by BellCodeEditor

save project

parent 31eff890
Showing with 14 additions and 14 deletions
...@@ -4,19 +4,19 @@ class Hero: ...@@ -4,19 +4,19 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20)
def shengji(self):
self.level = self.level + 1
self.hp = self.hp + 100
self.attack = self.attack + 200
yase=Hero('yase',300,200)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
k=Hero('K',5600,199) houyi=Hero('houyi',5600,199)
print(yase.attack) print(yase.attack)
print(hy.attack) print(hy.attack)
print(k.attack) print(houyi.attack)
yase.shengji()
def shengji(): print(yase.level,yase.hp,yase.attack)
yase.level = yase.level + 1 houyi.shengji()
yase.hp = yase.hp + 1000 print(houyi.level,houyi.hp,houyi.attack)
yase.attack = yase.attack + 1 \ No newline at end of file
shengji()
shengji()
print(yase.level,yase.hp,yase.attack)
\ No newline at end of file
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