Commit d3926aea by BellCodeEditor

save project

parent 7a5374f9
Showing with 9 additions and 3 deletions
class Hero:
def __init__(self,name,attack,hp):
self.hp=hp
self.lever=1
self.level=1
self.attack=attack
self.name=name
ysae=Hero('亚瑟',20,300)
def upgrade():
ysae.hp=ysae.hp+50
ysae.level=ysae.level+1
ysae.attack=ysae.attack+4
upgrade()
upgrade()
print(ysae.hp)
\ 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