Commit f1a0c60c by BellCodeEditor

save project

parent 4ac15d4d
Showing with 8 additions and 7 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def Xuzimai(self):
self.level+=1
self.hp+=1000
self.attack+=200
Lixin=Hero('Lixin',3600,190)
def Xuzimai():
Lixin.hp+=1000
Lixin.level+=1
Lixin.attack+=200
Xuzimai()
Xuzimai()
Lixin.Xuzimai()
print(Lixin.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