Commit d4ac94c7 by BellCodeEditor

auto save

parent 21783ef1
Showing with 16 additions and 0 deletions
class hero:
def __init__(self,hp,hk):
self.level=1
self.hp=hp
self.hk=hk
ye=hero(100,12)
ye.hp=300
print(ye.hp)
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.hk=self.hk+30
upgrade(ye)
print(ye.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