Commit 0c447ee7 by BellCodeEditor

save project

parent 74ce24e0
Showing with 13 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.HP=hp
self.attack=attack
def upgrade(self):
self.level=self.level+1
self.HP=self.HP+999999999999999
self.attack=self.attack+10000000000000000000
yadang=Hero('亚当',30,1)
yadang.upgrade()
print(yadang.level)
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