Commit 97d9bb6c by BellCodeEditor

save project

parent d6c81a0f
Showing with 20 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
lixin=Hero('lixin',1569,156)
lan=Hero('lan',1789,230)
def shengji():
lixin.level=lixin.level+1
lixin.hp=lixin.hp+100
lixin.attack=lixin.attack+100
lan.level=lan.level+1
lan.hp=lan.hp+100
lan.attack=lan.attack+100
shengji()
shengji()
print(lixin.attack)
print(lan.attack)
\ 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