Commit 0c11fbc5 by BellCodeEditor

save project

parent 22354288
Showing with 19 additions and 0 deletions
class hero:
def __init__(a,name,hp,att):
a.level=1
a.name=name
a.hp=hp
a.att=att
def b(a):
a.hp=a.hp+10
a.att=a.att+20
zhaoyun=hero("赵云",300,50)
houyi=hero("后羿",200,80)
zhaoyun.b()
houyi.b()
print(zhaoyun.hp)
print(houyi.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