Commit 1ca27936 by BellCodeEditor

save project

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