Commit b30f70c1 by BellCodeEditor

save project

parent 0cdc9007
Showing with 14 additions and 2 deletions
......@@ -8,7 +8,18 @@ class Hero(object):
def fff(self,e):
e.hp-=self.attack
a=
s
a=self.name+'对'+e.name+'造成了'
s=str(self.attack)+'伤害'
if e.hp>0:
d='还剩下'+str(e.hp)+'的血量'
f=a+s+d
print(f)
else:
d=e.namd+'死亡,结束'
f=a+s+d
print(f)
exit()
yase = Hero("垭瑟")
houyi= Hero("后羿")
houyi.fff(yase)
\ 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