Commit b82a1f2a by BellCodeEditor

save project

parent 5b7900d0
Showing with 16 additions and 3 deletions
...@@ -5,9 +5,23 @@ class Hero: ...@@ -5,9 +5,23 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
k=Hero('K',5600,199) k=Hero('K',5600,199)
def a():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
def b():
hy.level=hy.level+1
hy.hp=hy.hp+50
hy.attack=hy.attack+4
def c():
k.level=k.level+1
k.hp=k.hp+50
k.attack=k.attack+4
a()
b()
c()
print(yase.attack) print(yase.attack)
print(hy.attack) print(hy.attack)
print(k.attack) print(k.attack)
print('亚瑟的血量是:'Hero.hp)
\ 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