Commit dffb9f8f by BellCodeEditor

save project

parent d7718a45
Showing with 13 additions and 2 deletions
class Hero: class Hero:
def __init__(self,name,level,hp,) def __init__(self,name,level,hp,attack):
\ No newline at end of file self.name=name
self.level=level
self.hp=hp
self.attack=attack
def ungrade(self):
self.level+=1
self.hp+=50
self.attack+=40
yase=Hero('亚瑟',1,300,240)
yase.ungrade()
print(yase.hp)
\ No newline at end of file
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