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