Commit 189a71bd by BellCodeEditor

save project

parent 6f6c8c30
Showing with 6 additions and 5 deletions
...@@ -4,13 +4,14 @@ class Hero: ...@@ -4,13 +4,14 @@ class Hero:
self.name=fun self.name=fun
self.hp=fun1 self.hp=fun1
self.attack=fun2 self.attack=fun2
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
f=Hero('yase',300,20) f=Hero('yase',300,20)
f1=Hero('houyi',250,23) f1=Hero('houyi',250,23)
def upgrade(): f.upgrade()
f.level=f.level+1 print(f.level)
f.hp=f.hp+50
f.attack=f.attack+4
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