Commit 1ca27936 by BellCodeEditor

save project

parent af8dbb15
Showing with 10 additions and 6 deletions
class Hero:
def __init__(self,name,Hp,attack):
def __init__(self,name,Hp,attack,level):
self.name=name
self.Hp=Hp
self.attack=attack
yase=Hero("yase",74574774474664,9999999999)
houyi=Hero("houyi",5656665,53453545354)
print(yase.Hp)
print(houyi.Hp)
\ No newline at end of file
self.level=level
yase=Hero("yase",74574774474664,9999999999,36545)
def upgrade():
yase.level=yase.level+1
yase.Hp=yase.Hp+50
yase.attack=yase.attack+4
upgrade()
print(yase.Hp)
\ 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