Commit c2c8c369 by BellCodeEditor

save project

parent e735783b
Showing with 3 additions and 10 deletions
...@@ -4,19 +4,11 @@ class Hero: ...@@ -4,19 +4,11 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def a(self,level,hp,attack):
yase=Hero("亚瑟",300,20) yase=Hero("亚瑟",300,20)
YTY=Hero("廷宇",100,1000) YTY=Hero("廷宇",100,1000)
print(yase.name) print(yase.name)
print(YTY.name) print(YTY.name)
def a():
YTY.level=1+1
YTY.hp=hp+5
YTY.attack=attack+5
def b():
yase.level=1+1
yase.hp=hp+5
yase.attack=attack+5
a()
b()
print(yase.hp) print(yase.hp)
print(YTY.hp) print(YTY.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