Commit 0ebbecbd by BellCodeEditor

save project

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