Commit d60b903a by BellCodeEditor

save project

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