Commit a98abe8b by BellCodeEditor

save project

parent 7a4f683c
Showing with 13 additions and 3 deletions
class Hero: class Hero:
def __init__(self,name,level,hp,attack): def __init__(self,level,hp,attack):
self.name=name
self.level=level self.level=level
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('亚瑟',1,3000,20) yase=Hero(1,3000,20)
def abc():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
abc()
abc()
print(yase.hp) print(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