Commit da4f155d by BellCodeEditor

save project

parent d6c81a0f
Showing with 49 additions and 0 deletions
class Helo:
def __init__(selp,name,hp,attack):
selp.level=1
selp.hp=hp
selp.attach=attack
hantian=Helo('寒天',3000,999)
zuanfeng=Helo('钻风',2400,2000)
yunying=Helo('云影',1000,500)
# print(hantian.hp)
# print(zuanfeng.hp)
# print(yunying.hp)
# print(hantian.attach)
# print(zuanfeng.attach)
# print(yunying.attach)
def hantianzengjia():
hantian.level=hantian.level+1
hantian.hp=hantian.hp+500
hantian.attach=hantian.attach+20
def zuanfrngzengjia():
zuanfeng.level=zuanfeng.level+1
zuanfeng.hp=zuanfeng.hp+500
zuanfeng.attach=zuanfeng.attach+20
def yunyingzengjia():
yunying.level=yunying.level+1
yunying.hp=yunying.hp+500
yunying.attach=yunying.attach+20
hantianzengjia()
zuanfrngzengjia()
yunyingzengjia()
print(hantian.hp)
print(zuanfeng.hp)
print(yunying.hp)
print(hantian.attach)
print(zuanfeng.attach)
print(yunying.attach)
\ No newline at end of file
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
hy=Hero('hy',250,23)
k=Hero('K',5600,199)
print(yase.attack)
print(hy.attack)
print(k.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