Commit 9fc6e5e2 by BellCodeEditor

auto save

parent 96e5815c
Showing with 33 additions and 2 deletions
class hero:
def __init__(self):
self.level=1
self.hp=300
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
self.name=name
self.hp=hp
self.attack=attack
yase=hero("亚瑟"300,20)
houyi=hero(后羿"240",23)
print("亚瑟的鞋是300"20)
print("后羿的鞋是240"23)
\ No newline at end of file
defupde() :
yase.level=yase.level+1
yase.hp =yase .hp + 50
yase.attack= yase .attack + 4
class Hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp= hp
self.attack= attack
def upgrade(self):
self.level=self.level+1
f.hpsel = self.hp + 50
self.attack = self.attack + 4
houyi = Hero("后羿",240,23)
houyi.upgrade()
print("等级为:",houyi.level)
print("血量为")
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