Commit b76c8bdd by BellCodeEditor

save project

parent 95c91a64
Showing with 5 additions and 17 deletions
class hero: bros=["刘备","关羽","张飞"]
def __init__(self,name,hp,attack): bros[0]="关羽"
self.level=1 bros[1]="刘备"
self.name=name print(bros)
self.hp=hp \ No newline at end of file
self.attack=attack
yase=hero("亚瑟",200,300)
houyi=hero("后羿",300,200)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
upgrade()
upgrade()
print(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