Commit f96dcda2 by BellCodeEditor

save project

parent f12bce5d
Showing with 7 additions and 1 deletions
...@@ -4,5 +4,10 @@ class Hero: ...@@ -4,5 +4,10 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
lv=Hero("lv",15,11) def a(self):
self.level=self.level+1
self.hp=self.hp+20
self.attack=self.attack+10
lv=Hero("lv",300,50)
lv.a()
print(lv.hp) print(lv.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