Commit 5949cf41 by BellCodeEditor

save project

parent d6c81a0f
Showing with 31 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp = hp
self.attack = attack
def shengji():
Yao.level = Yao.level+1
Yao.hp = Yao.hp+700
Yao.attack = Yao.attack+1
def shengji1():
Lan.level = Lan.level+1
Lan.hp = Lan.hp+700
Lan.attack = Lan.attack+1
# def shengji2():
# Lan.level = Lan.level+1
# Lan.hp = Lan.hp+700
# Lan.attack = Lan.attack+1
Yao = Hero("耀",2700,200)
Lan = Hero("澜",2800,200)
LiBai = Hero("李白",3000,270)
print('耀的血量是',Yao.hp)
print('澜的血量是',Lan.hp)
print('李白的血量是',LiBai.hp)
shengji()
\ 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