Commit 0cc392b8 by BellCodeEditor

save project

parent cc883746
Showing with 11 additions and 6 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=18 self.level=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
kst=Hero('奎桑提',4700,329) kst=Hero('奎桑提',970,129)
sn=Hero('赛娜',2900,487)
print("kst" ,kst.hp) def upgrade():
print("sn",sn.hp) kst.level=kst.level+1
\ No newline at end of file kst.hp=kst.hp+45
kst.attack=kst.attack+15
upgrade
upgrade
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