Commit 42c909d7 by BellCodeEditor

save project

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