Commit d1612a81 by BellCodeEditor

save project

parent 489fdf62
Showing with 6 additions and 6 deletions
......@@ -4,13 +4,13 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
def shengji():
self.hp=yase.hp+50
self.attack=yase.attack+5
self.level=yase.level+1
def shengji(self):
self.hp=self.hp+50
self.attack=self.attack+5
self.level=self.level+1
yase=Hero("亚瑟",300,20,1)
dijia=Hero("迪迦",200,30,1)
yase.shengji()
print(yase.name+str(yase.hp))
print(dijia.name+str(yase.hp))
\ No newline at end of file
print(dijia.name+str(dijia.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