Commit 4f527855 by BellCodeEditor

auto save

parent aec2c7d3
Showing with 6 additions and 2 deletions
......@@ -8,8 +8,12 @@ class Hero(object):
def combat(self,b): # 攻击
b.hp=b.hp-self.attack
if b.hp>0:
print(b.name+"海参"+str(b.hp))
else:
print(b.name+"被"+self.name+"杀死了")
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
print(houyi.hp)
\ No newline at end of file
houyi.combat(houyi)
\ 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