Commit fb8afcbe by BellCodeEditor

auto save

parent c94f58f7
Showing with 6 additions and 0 deletions
...@@ -4,5 +4,11 @@ class Hero: ...@@ -4,5 +4,11 @@ class Hero:
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(self):
self.level += 1
self.hp +=100
self.attack +=20
yase = Hero("哦",300,20) yase = Hero("哦",300,20)
houyi = Hero("快到",240,23) houyi = Hero("快到",240,23)
yase.upgrade()
print(yase.attack)
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