Commit 42c909d7 by BellCodeEditor

save project

parent bd5dc6b9
Showing with 11 additions and 10 deletions
...@@ -4,14 +4,15 @@ class hero: ...@@ -4,14 +4,15 @@ class hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def abcd(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=hero("垭瑟",300,20) yase=hero("垭瑟",300,20)
houyi=hero("后羿",250,23) houyi=hero("后羿",250,23)
yase.abcd()
yase.abcd()
def abcd(): print("垭瑟的等级",yase.level)
yase.level=yase.level+1 print("垭瑟的血量",yase.hp)
yase.hp=yase.hp+50 print("垭瑟的血攻击力",yase.attack)
yase.attack=yase.attack+4 \ No newline at end of file
abcd()
abcd()
print("垭瑟的血量",yase.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