Commit cec87a77 by BellCodeEditor

save project

parent 3591033e
Showing with 11 additions and 7 deletions
......@@ -4,11 +4,15 @@ class hero:
self.name = name
self.hp=hp
self.attack=attack
def shenji(self):
self.hp=self.hp+50
self.level=self.level+1
self.attack=self.attack+4
yase=hero("yase",300,200)
def upgraed():
yase.hp=yase.hp+50
yase.level=yase.level+1
yase.attack=yase.attack+4
upgraed()
print(yase.hp)
\ No newline at end of file
yase.shenji()
print(yase.hp)
houyi = hero("后裔",200,400)
houyi.shenji()
print(houyi.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