Commit e3c9e92b by BellCodeEditor

save project

parent d60b903a
Showing with 10 additions and 8 deletions
...@@ -4,11 +4,13 @@ class Hero: ...@@ -4,11 +4,13 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def a(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+20
def a(self): ys=Hero('ys',300,20)
self.level=self.level+1 hy=Hero('hy',240,30)
self.hp=self.hp+50 ys.a()
self.attack=self.attack+20 hy.a()
print(ys.hp)
hy=hy1 \ No newline at end of file
print(hy1.hp)
\ No newline at end of file
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