Commit 4a688d9b by BellCodeEditor

save project

parent f47689a4
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 upgrade():
晟.level=晟.level+1
晟.hp=晟.hp+50
晟.attack=晟.attack+20
def upgradee():
澜.level=澜.level+1
澜.hp=澜.hp+45
澜.attack=澜.attack+29
晟 = Hero("晟",1879,395)
澜 = Hero("澜",1350,496)
print("晟等级为:",晟.level)
print("晟血量为:",晟.hp)
print("晟攻击为:",晟.attack)
upgrade()
upgrade()
print("澜等级为:",澜.level)
print("澜血量为:",澜.hp)
print("澜攻击为:",澜.attack)
upgradee()
upgradee()
\ 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