Commit e3c9e92b by BellCodeEditor

save project

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