Commit e98201c1 by BellCodeEditor

save project

parent 0e09622a
Showing with 6 additions and 7 deletions
...@@ -6,10 +6,9 @@ class Hero: ...@@ -6,10 +6,9 @@ class Hero:
self.attack=attack self.attack=attack
ys =Hero("亚瑟",120,20) ys =Hero("亚瑟",120,20)
hy=Hero("后裔",100,23) hy=Hero("后裔",100,23)
print(ys.hp)
print(hy.hp)
def up(): def up():
ys.level=ys.lesel+1 ys.level=ys.level+1
ys.hp=ya.hp+50 ys.hp=ys.hp+50
print(ys.hp) up()
up print(ys.hp,ys.level,ys.name)
\ No newline at end of file \ 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