Commit cad87482 by BellCodeEditor

auto save

parent 09422ba4
Showing with 15 additions and 0 deletions
class hero:
def __init__(self,level,hp):
self.level=1
self.name=name
self.hp=hp
def upgrade(self):
self.level+=1.5
self.hp+=2.5
guanyu=hero("关羽"1,0)
guanyu.upgrade()
print(machao.hp)
print(guanyu.level)
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