Commit 55aada49 by BellCodeEditor

auto save

parent 70850cf8
Showing with 15 additions and 0 deletions
class Hero():
def __init__(self,hp):
self.level = 1
self.hp = hp
self.attack = 20
def upgrade(self):
self.level = self.level + 1
self.hp = self.hp + 20
self.attack = self.attack + 1
yase = Hero(100)#yase是具体的对象
wuko = Hero(200)#wuko 是具体的对象
yase.upgrade()
wuko.upgrade()
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