Commit 33f20e8e by BellCodeEditor

save project

parent d6c81a0f
Showing with 21 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=95
self.name=name
self.hp=hp
self.attack=attack
yuange=Hero('yuange',2,879)
bailixuance=Hero('bailixuance',390,67)
make=Hero('make',34,600)
print(yuange.attack)
print(bailixuance.attack)
print(make.attack)
def upgrade():
yuange.level=yuange.level+1
yuange.hp=yuange.hp+50
yuange.attack=yuange.attack+4
upgrade()
upgrade()
print(yuange.attack)
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