Commit e2f82b7a by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero:
def_init_(shlf,level,hp,attack):
shlf.level=1
shlf.hp=300
shlf.attack=5
yase=Hero()
print(yase)
def Xxx():
yase.level= shlf.level+1
yase.hp=shlf.hp+30
yase.attack=shlf.attack+5
yase=Hero("yase",300,20)
print("血量为"yase.hp)
Xxx()
Xxx()
print(yase.level,yase.hp,yase.attack)
\ 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