Commit bce1d9ad by BellCodeEditor

save project

parent 70850cf8
Showing with 15 additions and 0 deletions
class Hero:
def __init__(self, level,name,hp,age):
self.level = level
self.name = name
self.hp = hp
self.age = age
yase = Hero(1,'亚瑟', 500,45)
zhaoyun = Hero(15,'赵云', 350,22)
print(zhaoyun.age)
def up_level:
zhaoyun.level + =1
zhaoyun.hp+=5
zhaoyun.age+=1
up()
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