Commit 76e34bda by BellCodeEditor

save project

parent f47689a4
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=hp
self.name=name
self.attack=attack
def pp(self):
self.attack=self.attack+1
self.hp=self.hp+5
self.level=self.level+1
yunying=Hero('name',666,280)
胡桃=Hero('name',75,995)
胡桃.pp()
胡桃.pp()
胡桃.pp()
胡桃.pp()
print('云缨:',yunying.hp)
print('胡桃:',胡桃.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