Commit dc2fbb04 by BellCodeEditor

save project

parent 607600d6
Showing with 6 additions and 15 deletions
class Hero: class Hero:
def __init__(self,name,hp,attack): def __init__(self):
self.name=name self.level=1
self.hp=hp self.ph=300
self.attack=attack self.attact=20
yase=Hero("亚瑟",200,150) yase=Hero()
def upgrade(): \ No newline at end of file
yase.hp=yase.hp+100
yase.attack=yase.attack+50
upgrade()
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