Commit a64d41ee by BellCodeEditor

auto save

parent f47689a4
Showing with 16 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attck):
self.name = name
self.hp = hp
self.level = 1
self.attack = attck
yase = Hero('亚瑟',250,30)
print(yase.hp)
def upgrade(name):
name.level += 1
name.hp += 50
name.attack += 4
upgrade(yase)
print(yase.hp)
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