Commit 986b980f by BellCodeEditor

auto save

parent 486c0ddf
Showing with 9 additions and 11 deletions
class Hero:
def __init__(self,name,hp,attack):
def __init__(self,name):
self.name=name
self.hp=hp
self.attack=attack
self.hp=250
self.attack=40
self.level=1
def upgrade(self):
self.level+=1
self.hp+=100
self.attack+=100
yase=Hero("亚瑟",1000,10000)
yase.upgrade()
print(yase.hp)
\ No newline at end of file
# def upgrade(self):
# self.level+=1
# self.hp+=100
# self.attack+=100
yase=Hero("亚瑟")
\ 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