Commit e991e316 by BellCodeEditor

save project

parent 6cd7cba9
Showing with 20 additions and 7 deletions
class Hero: class Hero:
def __int__(self): def __int__(self,name,hp,attack):
self.hp=300 self.Hp = hp
self.level=1 self.name = name
self.attack=20 self.level = 1
yase = Hero() self.attack = attack
print(yase.hp)
\ No newline at end of file yase = Hero("亚瑟",300,20)
houyi = Hero("后羿",240,23)
print(yase.name)
print(yase.hp)
print(yase.attack)
print(houyi.name)
print(houyi.hp)
print(houyi.attack)
def upgrade():
yase.level = yase.level+1
yase.hp = yase.hp+50
yase.attack = yase.attack+4
\ 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