Commit ec33f623 by BellCodeEditor

save project

parent 9e140fad
Showing with 12 additions and 3 deletions
class hero: class hero:
def __init__(self): def __init__(self,hp,attack,name):
self.level=1 self.level=1
self.hp=300 self.hp=hp
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 self.attack=attack
self.name=name
def update(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+5
yase=hero(300,20,"亚瑟")
yase.update()
print(yase.attack)
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