Commit d3690f9a by BellCodeEditor

save project

parent a4e2a2a4
Showing with 9 additions and 7 deletions
......@@ -4,18 +4,19 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
yase=Hero('yase',300,20)
# houyi=Hero('houyi',250,23)
# Kai=Hero('Kai',5600,199)
# print(yase.attack)
# print(houyi.attack)
# print(Kai.attack)
def abc():
yase.level = yase.level+1
yase.hp = yase.hp+50
yase.attack = yase.attack+5
abc()
abc()
def abc(self):
self.level = self.level+1
self.hp = self.hp+50
self.attack = self.attack+5
yase=Hero('yase',300,20)
yase.abc()
yase.abc()
print(yase.level)
print(yase.hp)
print(yase.attack)
\ 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