Commit 7f7617d4 by BellCodeEditor

save project

parent 5a68c348
Showing with 13 additions and 9 deletions
......@@ -4,14 +4,18 @@ class Hero:
self.hp = hp
self.attack = attack
self.level=1
def u(self):
self.hp=self.hp+20
self.attack = self.attack+10
self.level=self.level+1
yase = Hero("亚瑟",50,10)
yase.u()
yase.u()
print(yase.hp)
def shenji():
yase.hp=yase.hp+20
yase.attack = yase.attack+10
yase.level=yase.level+1
shenji()
shenji()
print(yase.hp)
\ No newline at end of file
houyi = Hero("后羿",40,20)
houyi.u()
houyi.u()
print(houyi.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