Commit 5fa9c883 by BellCodeEditor

save project

parent 3519cba4
Showing with 9 additions and 16 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self):
self.level=1 self.leve1 = 1
self.name = name self.hp = 300
self.hp=hp self.attack = 20
self.attack=attack yase=Hero("亚瑟")
yase = Hero("亚瑟",300,20) print(yase.hp.leve1)
print(yeas.hp)
def upgrade(): print(yase.attack)
self.level=yase.level+1 \ No newline at end of file
self.hp=yase.hp+50
self.attack=yase.attack+4
yase = Hero("",300,20)
yase = upgrade()
print("")
\ 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