Commit 8abc1511 by BellCodeEditor

save project

parent 22354288
Showing with 20 additions and 0 deletions
class Hero:
def __init__(self,neme,hp,ateack):
self.level = 1
self.HP = hp
self.ateack = ateack
self.neme = neme
def a(self):
self.level = self.level + 1
self.HP = self.HP + 50
self.ateack = self.ateack + 10
yase = Hero("亚瑟",300,50)
hoyi = Hero("后羿",370,80)
yase.a()
hoyi.a()
print(yase.HP)
print(hoyi.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