Commit 47e75038 by BellCodeEditor

save project

parent 595c608f
Showing with 10 additions and 8 deletions
...@@ -4,11 +4,13 @@ class Hero: ...@@ -4,11 +4,13 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attar=attar self.attar=attar
yase=Hero("亚瑟",300,20)
def updent(): def updent(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+40 self.hp=self.hp+40
yase.attar=yase.attar+1 self.attar=self.attar+5
updent() yase=Hero("亚瑟",300,10)
updent() yase.updent()
print(yase.hp) print("等级是"+str(yase.level))
print("血量"+str(yase.hp))
print("攻击"+str(yase.attar))
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