Commit 47e75038 by BellCodeEditor

save project

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