Commit 189a71bd by BellCodeEditor

save project

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