Commit e3ef4c36 by BellCodeEditor

save project

parent 8f4d12d2
Showing with 9 additions and 3 deletions
class hero: class Hero:
def _hero_(self,name,hp,attack): def _Hero_(self,name,hp,attack):
self.levl=1 self.levl=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=hero("ya瑟",300,20) def shengji():
yase.levl=yase.levl+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase=Hero("ya瑟",300,20)
print("ya瑟的血量为:",yase.hp) print("ya瑟的血量为:",yase.hp)
shengji()
print("升级2次后,ya瑟的血量为:",yase.hp)
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